From 1e948e185903d45445341d61beb61986059e2fb6 Mon Sep 17 00:00:00 2001 From: jowj Date: Thu, 30 May 2019 17:39:46 -0500 Subject: [PATCH] Revert api upgrade changes; update dockerfile. --- docker/dockerfile | 3 +-- mojojojo-bot.py | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docker/dockerfile b/docker/dockerfile index ebd3a39..ed14fbc 100644 --- a/docker/dockerfile +++ b/docker/dockerfile @@ -14,8 +14,7 @@ RUN pip3 install --upgrade pip RUN pip3 install --upgrade setuptools -RUN pip3 install slackclient==2.0.0 -RUN pip3 install requests six websocket +RUN pip3 install slackclient<2.0.0 COPY ./ ./ diff --git a/mojojojo-bot.py b/mojojojo-bot.py index 9e61a59..1906346 100644 --- a/mojojojo-bot.py +++ b/mojojojo-bot.py @@ -5,13 +5,13 @@ import logging import json from pathlib import Path -from slack import WebClient +from slackclient import SlackClient from json import JSONDecoder from random import randint from functools import partial # instantiate Slack client -slack_client = WebClient(os.environ.get('SLACK_BOT_TOKEN')) +slack_client = SlackClient(os.environ.get('SLACK_BOT_TOKEN')) # starterbot's user ID in Slack: value is assigned after the bot starts up starterbot_id = None # channel i want to get ID from @@ -106,7 +106,6 @@ def handle_command(command, channel): def reactable_message(event): """Test whether a (Slack) event is a reaction-able message - Check whether it's not a DM, it's not empty, and it's actually a message """ return 'channel' in event and 'text' in event and event.get('type') == 'message' @@ -193,4 +192,4 @@ if __name__ == "__main__": else: print("Connection failed. Exception traceback printed above.") logging.info('Check console for exception traceback.') - logging.info('Finished') +logging.info('Finished')