chore: auto-commit from dashboard
This commit is contained in:
@@ -1171,6 +1171,16 @@ def create_bot(config: Config) -> discord.Client:
|
||||
user_id = str(message.author.id)
|
||||
text = message.content
|
||||
|
||||
# Download attachments to /tmp and append paths to text
|
||||
for attachment in message.attachments:
|
||||
tmp_path = f"/tmp/{attachment.filename}"
|
||||
try:
|
||||
await attachment.save(tmp_path)
|
||||
text = (text + f"\n[ATTACHMENT:{tmp_path}]").strip()
|
||||
logger.info("Saved attachment: %s (%d bytes)", tmp_path, attachment.size)
|
||||
except Exception:
|
||||
logger.exception("Failed to save attachment: %s", attachment.filename)
|
||||
|
||||
# React to acknowledge receipt
|
||||
await message.add_reaction("\U0001f440")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user