Commit 48dcdd6 Denis
committed Oct 9, 2018
1 parent 8a49829 commit 48dcdd6 Copy full SHA for 48dcdd6
File tree 3 files changed +26
-2
lines changed
3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 1
1
process . env . NTBA_FIX_319 = 1 ;
2
2
3
3
var TelegramBot = require ( 'node-telegram-bot-api' ) ;
4
+ const Agent = require ( 'socks5-https-client/lib/Agent' )
5
+
4
6
5
7
var emoji = require ( 'node-emoji' ) ;
6
8
var fs = require ( 'fs' ) ;
@@ -32,7 +34,19 @@ config.loadConfigurationFile().then(() => {
32
34
} ) ;
33
35
34
36
function start_bot ( ) {
35
- var bot = new TelegramBot ( init . TOKEN , { polling : true } ) ;
37
+ var bot = new TelegramBot ( init . TOKEN , {
38
+ polling : true ,
39
+ // request: {
40
+ // agentClass: Agent,
41
+ // agentOptions: {
42
+ // socksHost: init.proxy.host,
43
+ // socksPort: parseInt(init.proxy.port),
44
+ // // If authorization is needed:
45
+ // // socksUsername: init.proxy.username,
46
+ // // socksPassword: init.proxy.password
47
+ // }
48
+ // }
49
+ } ) ;
36
50
37
51
bot . on ( 'message' , function ( msg ) {
38
52
// Actions to SAVE
Original file line number Diff line number Diff line change @@ -15,6 +15,13 @@ var menu = {};
15
15
var menu_root ;
16
16
var admins = [ ] ;
17
17
18
+ var proxy = {
19
+ 'host' : '' ,
20
+ 'port' : '' ,
21
+ 'username' : '' ,
22
+ 'password' : ''
23
+ }
24
+
18
25
var MSG_START = "Use menu" ;
19
26
var MSG_DEFAULT = "Click to button" ;
20
27
var MSG_BACK = function ( key ) { return "Back to " + key }
@@ -106,6 +113,8 @@ module.exports.menu = menu;
106
113
module . exports . menu_root = menu_root ;
107
114
module . exports . admins = admins ;
108
115
116
+ module . exports . proxy = proxy ;
117
+
109
118
module . exports . MSG_START = MSG_START ;
110
119
module . exports . MSG_DEFAULT = MSG_DEFAULT ;
111
120
module . exports . MSG_BACK = MSG_BACK ;
Original file line number Diff line number Diff line change 18
18
"homepage" : " https://github.com/zZoMROT/telegram-bot-menu#readme" ,
19
19
"dependencies" : {
20
20
"node-emoji" : " ^1.8.1" ,
21
- "node-telegram-bot-api" : " ^0.30.0"
21
+ "node-telegram-bot-api" : " ^0.30.0" ,
22
+ "socks5-https-client" : " ^1.2.1"
22
23
}
23
24
}
You can’t perform that action at this time.
0 commit comments