Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
attachments to backup
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|