Slack: Support private channels
This commit is contained in:
parent
8e7c6eedba
commit
7f6830e377
1 changed files with 16 additions and 3 deletions
|
@ -76,11 +76,16 @@ class SlackPlatform(Platform):
|
|||
logger.debug("Discarding message", data=data)
|
||||
return
|
||||
|
||||
if data["event"]["type"] != "message":
|
||||
logger.debug("Parsing message", platform=cls.ID, data=data)
|
||||
|
||||
if data["event"]["type"] not in ("message", "message.groups"):
|
||||
return
|
||||
|
||||
logger.debug("Parsing message", platform=cls.ID, data=data)
|
||||
return Message(
|
||||
# Surprisingly, this *can* happen.
|
||||
if "text" not in data["event"]:
|
||||
return
|
||||
|
||||
message = Message(
|
||||
id=data["event"].get("thread_ts", data["event"]["ts"]),
|
||||
author=data["event"].get("user"),
|
||||
from_bot="bot_id" in data["event"],
|
||||
|
@ -90,3 +95,11 @@ class SlackPlatform(Platform):
|
|||
channel=cls.parse_channel_from_message(data),
|
||||
raw=data,
|
||||
)
|
||||
|
||||
logger.info(
|
||||
"New message",
|
||||
platform=message.channel.platform,
|
||||
channel=cls.parse_channel_name_from_raw(message.channel.channel_raw),
|
||||
)
|
||||
|
||||
return message
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue