2424 if 'name' in user and user .get ('name' ) == SLACK_BOT_NAME :
2525 BOT_ID = user .get ('id' )
2626else :
27- print ("Could not reach Slack with your SLACK_BOT_TOKEN. Please check if your SLACK_BOT_TOKEN and SLACK_BOT_NAME are both correct." )
27+ print ('Could not reach Slack with your SLACK_BOT_TOKEN. Please check if ' +
28+ 'your SLACK_BOT_TOKEN and SLACK_BOT_NAME are both correct.' )
2829 exit (1 )
2930
3031try :
3132 BOT_ID
3233except NameError :
33- print ('Could not find bot with the name ' + SLACK_BOT_NAME + '. Please check if your SLACK_BOT_TOKEN and SLACK_BOT_NAME are both correct.' )
34+ print ('Could not find bot with the name ' + SLACK_BOT_NAME + '. Please ' +
35+ 'check if your SLACK_BOT_TOKEN and SLACK_BOT_NAME are both correct.' )
3436 exit (1 )
3537
3638
@@ -86,9 +88,9 @@ def handle_request(message, channel, ts, user):
8688
8789 # send messages to channel
8890 slack_client .api_call ('chat.postMessage' ,
89- channel = channel ,
90- text = unmentioned_message ,
91- as_user = True )
91+ channel = channel ,
92+ text = unmentioned_message ,
93+ as_user = True )
9294
9395
9496def parse_slack_output (event_list ):
@@ -112,9 +114,11 @@ def parse_slack_output(event_list):
112114 if slack_client .rtm_connect ():
113115 print ('%s connected' , __file__ )
114116 while True :
115- request , channel , ts , user = parse_slack_output (slack_client .rtm_read ())
117+ request , channel , ts , user = parse_slack_output (
118+ slack_client .rtm_read ())
116119 if request and channel :
117- print ('slack_message:|' + str (request ) + '|' + str (channel ) + '|' + str (ts ) + '|' + str (user ) + '|' )
120+ print ('slack_message:|' + str (request ) + '|' + str (channel ) +
121+ '|' + str (ts ) + '|' + str (user ) + '|' )
118122 handle_request (request , channel , ts , user )
119123 time .sleep (READ_WEBSOCKET_DELAY )
120124 else :
0 commit comments