Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -63,24 +63,24 @@ async def on_message(message):
|
|
63 |
|
64 |
huggingfolks_role = discord.utils.get(message.guild.roles, id=897376942817419265)
|
65 |
bots_role = discord.utils.get(message.guild.roles, id=1258328471609016341)
|
66 |
-
if huggingfolks_role not in message.author.roles: # no need for ping if we're already discussing
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
|
85 |
# Check if the message is in a thread
|
86 |
if isinstance(message.channel, discord.Thread):
|
|
|
63 |
|
64 |
huggingfolks_role = discord.utils.get(message.guild.roles, id=897376942817419265)
|
65 |
bots_role = discord.utils.get(message.guild.roles, id=1258328471609016341)
|
66 |
+
#if huggingfolks_role not in message.author.roles: # no need for ping if we're already discussing
|
67 |
+
if bots_role not in message.author.roles: # bots shouldn't trigger pings for this
|
68 |
+
print(" not bot ")
|
69 |
+
content = message.content.lower()
|
70 |
+
|
71 |
+
for trigger, slack_mention in TRIGGERS.items():
|
72 |
+
if all(word in content for word in trigger):
|
73 |
+
adjacent_words = extract_adjacent_words(message.content, trigger)
|
74 |
+
daily_pings.append({
|
75 |
+
'author': str(message.author),
|
76 |
+
'content': adjacent_words,
|
77 |
+
'channel': message.channel.name,
|
78 |
+
'url': message.jump_url,
|
79 |
+
'mention': slack_mention,
|
80 |
+
'trigger': trigger
|
81 |
+
})
|
82 |
+
print(f"daily pings:{daily_pings}")
|
83 |
+
break
|
84 |
|
85 |
# Check if the message is in a thread
|
86 |
if isinstance(message.channel, discord.Thread):
|