lunarflu HF staff commited on
Commit
0798371
1 Parent(s): 6026e85

attachments to backup

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -46,8 +46,14 @@ async def on_message(message):
46
  """Backup"""
47
  number_of_messages = number_of_messages + 1
48
  message_link = f"[#{message.channel.name}]({message.jump_url})"
49
- msgcnt = message.content
50
- dm_message = await lunarflu.send(f"{number_of_messages}|{message_link} |{message.author}: {message.content}")
 
 
 
 
 
 
51
 
52
  """Antispam"""
53
  #Detecting certain unwanted strings
 
46
  """Backup"""
47
  number_of_messages = number_of_messages + 1
48
  message_link = f"[#{message.channel.name}]({message.jump_url})"
49
+ msgcnt = message.content
50
+ backup_message = f"{number_of_messages} | {message_link} | {message.author}: {msg_content}"
51
+ # check for attachments
52
+ if message.attachments:
53
+ for attachment in message.attachments:
54
+ attachment_url = attachment.url
55
+ backup_message += f"\nAttachment: {attachment_url}"
56
+ dm_message = await lunarflu.send(backup_message)
57
 
58
  """Antispam"""
59
  #Detecting certain unwanted strings