File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed
docs/user_guide/configuration Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,18 @@ by setting up `BOT_IDENTITY` as follows::
3232 }
3333
3434
35+ Proxy setup
36+ -------------
37+
38+ In case you need to use a Proxy to connect to Slack,
39+ you can set the proxies with the token config.
40+
41+ BOT_IDENTITY = {
42+ 'token': 'xoxb-4426949411-aEM7...',
43+ 'proxies': {'http': 'some-http-proxy', 'https': 'some-https-proxy'}
44+ }
45+
46+
3547Bot admins
3648----------
3749
Original file line number Diff line number Diff line change @@ -291,6 +291,7 @@ def __init__(self, config):
291291 super ().__init__ (config )
292292 identity = config .BOT_IDENTITY
293293 self .token = identity .get ('token' , None )
294+ self .proxies = identity .get ('proxies' , None )
294295 if not self .token :
295296 log .fatal (
296297 'You need to set your token (found under "Bot Integration" on Slack) in '
@@ -359,7 +360,11 @@ def update_alternate_prefixes(self):
359360 log .debug ('Converted bot_alt_prefixes: %s' , self .bot_config .BOT_ALT_PREFIXES )
360361
361362 def serve_once (self ):
362- self .sc = SlackClient (self .token )
363+ if not self .proxies :
364+ self .sc = SlackClient (self .token )
365+ else :
366+ self .sc = SlackClient (self .token , proxies = self .proxies )
367+
363368 log .info ("Verifying authentication token" )
364369 self .auth = self .api_call ("auth.test" , raise_errors = False )
365370 if not self .auth ['ok' ]:
Original file line number Diff line number Diff line change 170170
171171 ## Slack mode (comment the others above if using this mode)
172172 # 'token': 'xoxb-4426949411-aEM7...',
173+ ## you can also include the proxy for the SlackClient connection
174+ # 'proxies': {'http': 'some-http-proxy', 'https': 'some-https-proxy'}
173175
174176 ## Telegram mode (comment the others above if using this mode)
175177 # 'token': '103419016:AAbcd1234...',
You can’t perform that action at this time.
0 commit comments