lunarflu HF staff commited on
Commit
b91f995
1 Parent(s): 780b804

users with bot role no longer trigger pings

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -53,12 +53,14 @@ async def on_message(message):
53
 
54
  # notification bot
55
  huggingfolks_role = discord.utils.get(message.guild.roles, id=897376942817419265)
 
56
  if huggingfolks_role not in message.author.roles: # no need for ping if we're already discussing
57
- content = message.content.lower()
58
- for trigger, slack_mention in TRIGGERS.items():
59
- if trigger in content:
60
- await post_to_slack(message.author, message.content, message.channel.name, message.jump_url, slack_mention, trigger)
61
- break
 
62
 
63
  # ask-for-help
64
  # discord.ForumChannel.last_message_id -> The last thread ID that was created on this forum.
 
53
 
54
  # notification bot
55
  huggingfolks_role = discord.utils.get(message.guild.roles, id=897376942817419265)
56
+ bots_role = discord.utils.get(message.guild.roles, id=1258328471609016341)
57
  if huggingfolks_role not in message.author.roles: # no need for ping if we're already discussing
58
+ if bots_role not in message.author.roles: # bots shouldn't trigger pings for this
59
+ content = message.content.lower()
60
+ for trigger, slack_mention in TRIGGERS.items():
61
+ if trigger in content:
62
+ await post_to_slack(message.author, message.content, message.channel.name, message.jump_url, slack_mention, trigger)
63
+ break
64
 
65
  # ask-for-help
66
  # discord.ForumChannel.last_message_id -> The last thread ID that was created on this forum.