updating solved tag reactions for other help channels as well (gradio, argilla, data-discussions)
Browse files
app.py
CHANGED
@@ -174,10 +174,11 @@ async def list_tags(ctx, forum_channel_id: int):
|
|
174 |
|
175 |
|
176 |
# react with β
on slack if marked with solved tag on discord
|
|
|
177 |
@bot.event
|
178 |
async def on_thread_update(before, after):
|
179 |
if isinstance(after.parent, discord.ForumChannel) and after.parent.id in {ASK_FOR_HELP_CHANNEL_ID, GRADIO_CHANNEL_ID, ARGILLA_HELP_CHANNEL_ID, DATA_DISCUSSIONS_CHANNEL_ID}:
|
180 |
-
if
|
181 |
discord_thread_id = after.id
|
182 |
if discord_thread_id in thread_mapping:
|
183 |
slack_thread_ts = thread_mapping[discord_thread_id]
|
|
|
174 |
|
175 |
|
176 |
# react with β
on slack if marked with solved tag on discord
|
177 |
+
SOLVED_TAG_IDS = {1026743978026094664, 1025179659215847575, 1263095032328753174, 1253641354312155208}
|
178 |
@bot.event
|
179 |
async def on_thread_update(before, after):
|
180 |
if isinstance(after.parent, discord.ForumChannel) and after.parent.id in {ASK_FOR_HELP_CHANNEL_ID, GRADIO_CHANNEL_ID, ARGILLA_HELP_CHANNEL_ID, DATA_DISCUSSIONS_CHANNEL_ID}:
|
181 |
+
if any(tag.id in SOLVED_TAG_IDS for tag in after.applied_tags):
|
182 |
discord_thread_id = after.id
|
183 |
if discord_thread_id in thread_mapping:
|
184 |
slack_thread_ts = thread_mapping[discord_thread_id]
|