Guest User

Untitled

a guest
Jan 29th, 2019
410
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from slackclient import SlackClient
  2.  
  3. SLACK_BOT_TOKEN = os.environ.get('SLACK_BOT_TOKEN')
  4. SLACK_BOT_OAUTH = os.environ.get('SLACK_BOT_OAUTH')
  5. slack_client = SlackClient(SLACK_BOT_OAUTH)
  6. bot_id = None
  7.  
  8. if __name__ == '__main__':
  9.     if slack_client.rtm_connect(with_team_state=False):
  10.         logger.info("StandupBot connected and ready to work!")
  11.         bot_id = slack_client.api_call("auth.test")["user_id"]
  12.         while True:
  13.             command = parse_slack_data(slack_client.rtm_read())
  14.             if command:
  15.                 command()
  16.             time.sleep(1)
  17.     else:
  18.         logger.error("Something went wrong.")
RAW Paste Data