This commit is contained in:
Felipe M 2020-07-03 17:34:49 +02:00
parent 89db0bb24d
commit 62c746bab7
Signed by: fmartingr
GPG Key ID: 716BC147715E716F
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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:

View File

@ -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,
)