lunarflu HF Staff commited on
Commit
c3bf220
·
verified ·
1 Parent(s): 070e38e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -78,13 +78,14 @@ async def on_message(message):
78
  if bots_role not in message.author.roles: # bots shouldn't trigger pings for this
79
  print(" not bot ")
80
  content = message.content.lower()
 
81
  for trigger, slack_mention in TRIGGERS.items():
82
  if all(word in content for word in trigger):
83
  daily_pings.append({
84
  'author': str(message.author),
85
  'content': message.content,
86
  'channel': message.channel.name,
87
- 'url': message.jump_url,
88
  'mention': slack_mention,
89
  'trigger': trigger
90
  })
@@ -153,7 +154,7 @@ def send_daily_pings():
153
  if daily_pings:
154
  print("sending daily pings...")
155
  # combine into one message
156
- combined_message = '\n'.join(f"{ping['author']} in #{ping['channel']} said: {ping['content']} (link: <{ping['url']}>)" for ping in daily_pings)
157
  #await post_to_slack(None, combined_message, SLACK_CHANNEL_ID_TEST, None, None, None)
158
 
159
 
 
78
  if bots_role not in message.author.roles: # bots shouldn't trigger pings for this
79
  print(" not bot ")
80
  content = message.content.lower()
81
+ message_jump_url = "<" + message.jump_url + ">"
82
  for trigger, slack_mention in TRIGGERS.items():
83
  if all(word in content for word in trigger):
84
  daily_pings.append({
85
  'author': str(message.author),
86
  'content': message.content,
87
  'channel': message.channel.name,
88
+ 'url': message_jump_url,
89
  'mention': slack_mention,
90
  'trigger': trigger
91
  })
 
154
  if daily_pings:
155
  print("sending daily pings...")
156
  # combine into one message
157
+ combined_message = '\n'.join(f"{ping['author']} in #{ping['channel']} said: {ping['content']} ( link: {ping['url']})" for ping in daily_pings)
158
  #await post_to_slack(None, combined_message, SLACK_CHANNEL_ID_TEST, None, None, None)
159
 
160