Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
rename give-hf-feedback to community-feedback, turn into forum channel type (more compatible with slack and easier to track individual pieces of feedback)
Browse files
app.py
CHANGED
|
@@ -27,7 +27,7 @@ ASK_FOR_HELP_CHANNEL_ID = 1019883044724822016
|
|
| 27 |
GRADIO_CHANNEL_ID = 1025174734427656283
|
| 28 |
ARGILLA_HELP_CHANNEL_ID = 1253640751481356330
|
| 29 |
DATA_DISCUSSIONS_CHANNEL_ID = 1217179426002047076
|
| 30 |
-
|
| 31 |
|
| 32 |
TRIGGERS = {
|
| 33 |
("discord bot",): ["<@U051DB2754M>"], # adam
|
|
@@ -115,9 +115,6 @@ async def on_message(message):
|
|
| 115 |
# post to slack only if thread already exists
|
| 116 |
post_to_slack_forum_version(message, SLACK_CHANNEL_ID, message.content, message.author, thread_ts=slack_thread_ts)
|
| 117 |
|
| 118 |
-
if message.channel.id == GIVE_HF_FEEDBACK_CHANNEL_ID:
|
| 119 |
-
post_to_slack_general(message, SLACK_CHANNEL_ID)
|
| 120 |
-
|
| 121 |
await bot.process_commands(message)
|
| 122 |
|
| 123 |
|
|
@@ -156,7 +153,7 @@ def extract_adjacent_words(content, trigger):
|
|
| 156 |
@bot.event
|
| 157 |
async def on_thread_create(thread):
|
| 158 |
# (discord) must be the child thread of the CORRECT forum channel(s) (not just any thread, or any forum channel)
|
| 159 |
-
if isinstance(thread.parent, discord.ForumChannel) and thread.parent.id in {ASK_FOR_HELP_CHANNEL_ID, GRADIO_CHANNEL_ID, ARGILLA_HELP_CHANNEL_ID, DATA_DISCUSSIONS_CHANNEL_ID}:
|
| 160 |
discord_thread_id = thread.id
|
| 161 |
slack_thread_ts = post_to_slack_create_thread(
|
| 162 |
SLACK_CHANNEL_ID,
|
|
@@ -214,7 +211,7 @@ async def list_tags(ctx, forum_channel_id: int):
|
|
| 214 |
SOLVED_TAG_IDS = {1026743978026094664, 1025179659215847575, 1263095032328753174, 1253641354312155208}
|
| 215 |
@bot.event
|
| 216 |
async def on_thread_update(before, after):
|
| 217 |
-
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}:
|
| 218 |
|
| 219 |
before_tag_ids = {tag.id for tag in before.applied_tags}
|
| 220 |
after_tag_ids = {tag.id for tag in after.applied_tags}
|
|
|
|
| 27 |
GRADIO_CHANNEL_ID = 1025174734427656283
|
| 28 |
ARGILLA_HELP_CHANNEL_ID = 1253640751481356330
|
| 29 |
DATA_DISCUSSIONS_CHANNEL_ID = 1217179426002047076
|
| 30 |
+
COMMUNITY_FEEDBACK_CHANNEL_ID = 1353741359059570699
|
| 31 |
|
| 32 |
TRIGGERS = {
|
| 33 |
("discord bot",): ["<@U051DB2754M>"], # adam
|
|
|
|
| 115 |
# post to slack only if thread already exists
|
| 116 |
post_to_slack_forum_version(message, SLACK_CHANNEL_ID, message.content, message.author, thread_ts=slack_thread_ts)
|
| 117 |
|
|
|
|
|
|
|
|
|
|
| 118 |
await bot.process_commands(message)
|
| 119 |
|
| 120 |
|
|
|
|
| 153 |
@bot.event
|
| 154 |
async def on_thread_create(thread):
|
| 155 |
# (discord) must be the child thread of the CORRECT forum channel(s) (not just any thread, or any forum channel)
|
| 156 |
+
if isinstance(thread.parent, discord.ForumChannel) and thread.parent.id in {ASK_FOR_HELP_CHANNEL_ID, GRADIO_CHANNEL_ID, ARGILLA_HELP_CHANNEL_ID, DATA_DISCUSSIONS_CHANNEL_ID, COMMUNITY_FEEDBACK_CHANNEL_ID}:
|
| 157 |
discord_thread_id = thread.id
|
| 158 |
slack_thread_ts = post_to_slack_create_thread(
|
| 159 |
SLACK_CHANNEL_ID,
|
|
|
|
| 211 |
SOLVED_TAG_IDS = {1026743978026094664, 1025179659215847575, 1263095032328753174, 1253641354312155208}
|
| 212 |
@bot.event
|
| 213 |
async def on_thread_update(before, after):
|
| 214 |
+
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, COMMUNITY_FEEDBACK_CHANNEL_ID}:
|
| 215 |
|
| 216 |
before_tag_ids = {tag.id for tag in before.applied_tags}
|
| 217 |
after_tag_ids = {tag.id for tag in after.applied_tags}
|