don't add bot as a helper

This commit is contained in:
transcental 2025-07-03 18:58:14 +01:00
parent 677c74935e
commit eeee4063c1
No known key found for this signature in database
GPG key ID: 81E4B6CCB9561611

View file

@ -7,6 +7,14 @@ async def update_helpers():
res = await env.slack_client.conversations_members(channel=env.slack_bts_channel)
team_ids = res.get("members", [])
# Get bot user ID to exclude from helpers
bot_info = await env.slack_client.auth_test()
bot_user_id = bot_info.get("user_id")
# Filter out bot user from team_ids
if bot_user_id and bot_user_id in team_ids:
team_ids = [user_id for user_id in team_ids if user_id != bot_user_id]
if not team_ids:
# if this happens then something concerning has happened :p
await env.slack_client.chat_postMessage(