Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
exclude huggingfolks role from triggering notification pings (unneeded if we're discussing anyways)
Browse files
app.py
CHANGED
@@ -42,11 +42,13 @@ async def on_message(message):
|
|
42 |
return
|
43 |
|
44 |
# notification bot
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
50 |
|
51 |
# ask-for-help
|
52 |
# discord.ForumChannel.last_message_id -> The last thread ID that was created on this forum.
|
|
|
42 |
return
|
43 |
|
44 |
# notification bot
|
45 |
+
huggingfolks_role = discord.utils.get(message.guild.roles, id=897376942817419265)
|
46 |
+
if huggingfolks_role not in message.author.roles: # no need for ping if we're already discussing
|
47 |
+
content = message.content.lower()
|
48 |
+
for trigger, slack_mention in TRIGGERS.items():
|
49 |
+
if trigger in content:
|
50 |
+
await post_to_slack(message.author, message.content, message.channel.name, message.jump_url, slack_mention, trigger)
|
51 |
+
break
|
52 |
|
53 |
# ask-for-help
|
54 |
# discord.ForumChannel.last_message_id -> The last thread ID that was created on this forum.
|