fix: antipm pic
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -17,6 +17,7 @@ config.ini
|
||||
unknown_errors.txt
|
||||
moonlogs.txt
|
||||
thumb.jpg
|
||||
antipm_pic.jpg
|
||||
musicbot/
|
||||
.env
|
||||
.trunk/
|
||||
|
||||
@@ -230,13 +230,14 @@ async def set_antipm_pic(_, message: Message):
|
||||
await message.edit("antipm picture set to default.")
|
||||
return
|
||||
|
||||
photo = message.reply_to_message.photo
|
||||
file_id = photo.file_id
|
||||
await message.edit("Setting antipm picture...")
|
||||
|
||||
photo = await message.reply_to_message.download("./antipm_pic.jpg")
|
||||
|
||||
old_antipm_pic = db.get("core.antipm", "antipm_pic", None)
|
||||
if old_antipm_pic:
|
||||
db.remove("core.antipm", "antipm_pic")
|
||||
db.set("core.antipm", "antipm_pic", file_id)
|
||||
db.set("core.antipm", "antipm_pic", photo)
|
||||
await message.edit("antipm picture set successfully.")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user