Slack Connector to not Index Bots (#581)

This commit is contained in:
Yuhong Sun 2023-10-16 20:08:03 -07:00 committed by GitHub
parent b5982c10c3
commit bb9a18b22c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,7 +170,15 @@ _DISALLOWED_MSG_SUBTYPES = {
def _default_msg_filter(message: MessageType) -> bool:
return message.get("subtype", "") in _DISALLOWED_MSG_SUBTYPES
# Don't keep messages from bots
if message.get("bot_id") or message.get("app_id"):
return True
# Uninformative
if message.get("subtype", "") in _DISALLOWED_MSG_SUBTYPES:
return True
return False
def _filter_channels(