lunarflu HF staff commited on
Commit
e57e72d
1 Parent(s): 6c85ea0

exclude huggingfolks role from triggering notification pings (unneeded if we're discussing anyways)

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -42,11 +42,13 @@ async def on_message(message):
42
  return
43
 
44
  # notification bot
45
- content = message.content.lower()
46
- for trigger, slack_mention in TRIGGERS.items():
47
- if trigger in content:
48
- await post_to_slack(message.author, message.content, message.channel.name, message.jump_url, slack_mention, trigger)
49
- break
 
 
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.