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