From 62c746bab7e0233e97e297a9b1b01822c4156163 Mon Sep 17 00:00:00 2001 From: Felipe M Date: Fri, 3 Jul 2020 17:34:49 +0200 Subject: [PATCH] Typos --- butterrobot/app.py | 2 +- butterrobot/lib/slack.py | 4 ++-- butterrobot/platforms/slack.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/butterrobot/app.py b/butterrobot/app.py index a4708e6..677d978 100644 --- a/butterrobot/app.py +++ b/butterrobot/app.py @@ -16,7 +16,7 @@ logger = structlog.get_logger(__name__) app = Quart(__name__) available_platforms = {} plugins = get_available_plugins() -enabled_plugins = [plugin for plugin_name, plugin in plugins.items() if plugin in ENABLED_PLUGINS] +enabled_plugins = [plugin for plugin_name, plugin in plugins.items() if plugin_name in ENABLED_PLUGINS] @app.before_serving diff --git a/butterrobot/lib/slack.py b/butterrobot/lib/slack.py index f6fd875..48eb8dd 100644 --- a/butterrobot/lib/slack.py +++ b/butterrobot/lib/slack.py @@ -19,10 +19,10 @@ class SlackAPI: pass @classmethod - async def send_message(cls, platform, message, thread: Optional[Text] = None): + async def send_message(cls, channel, message, thread: Optional[Text] = None): payload = { "text": message, - "platform": platform, + "channel": channel, } if thread: diff --git a/butterrobot/platforms/slack.py b/butterrobot/platforms/slack.py index 36f88fb..71d9d7c 100644 --- a/butterrobot/platforms/slack.py +++ b/butterrobot/platforms/slack.py @@ -19,7 +19,7 @@ class SlackMethods(PlatformMethods): ) try: await SlackAPI.send_message( - platform=message.chat, message=message.text, thread=message.reply_to + channel=message.chat, message=message.text, thread=message.reply_to ) except SlackAPI.SlackClientError as error: logger.error( @@ -65,6 +65,6 @@ class SlackPlatform(Platform): id=data["event"].get("thread_ts", data["event"]["ts"]), date=datetime.fromtimestamp(int(float(data["event"]["event_ts"]))), text=data["event"]["text"], - chat=data["event"]["platform"], + chat=data["event"]["channel"], raw=data, )