Fix pastebin

This commit is contained in:
yasir 2023-02-13 22:54:08 +07:00
parent 8a2bee8e91
commit 206db5c01b

View file

@ -58,10 +58,9 @@ async def mediainfo(client, message):
} }
response = await http.post("https://paste.yasir.eu.org/api/new", json=json_data) response = await http.post("https://paste.yasir.eu.org/api/new", json=json_data)
link = f"https://paste.yasir.eu.org/{response.json()['id']}" link = f"https://paste.yasir.eu.org/{response.json()['id']}"
markup = InlineKeyboardMarkup([[InlineKeyboardButton(text_, link)]])
except Exception as e: except Exception as e:
LOGGER.error(e) markup = None
link = None
markup = InlineKeyboardMarkup([[InlineKeyboardButton(text_, link)]])
await kirimPesan(message, " <b>MEDIA INFO</b>", reply_markup=markup, quote=True) await kirimPesan(message, " <b>MEDIA INFO</b>", reply_markup=markup, quote=True)
await process.delete() await process.delete()
try: try:
@ -91,9 +90,9 @@ async def mediainfo(client, message):
} }
response = await http.post("https://paste.yasir.eu.org/api/new", json=json_data) response = await http.post("https://paste.yasir.eu.org/api/new", json=json_data)
link = f"https://paste.yasir.eu.org/{response.json()['id']}" link = f"https://paste.yasir.eu.org/{response.json()['id']}"
markup = InlineKeyboardMarkup([[InlineKeyboardButton(text="💬 View in Web", url=link)]])
except: except:
link = None markup = None
markup = InlineKeyboardMarkup([[InlineKeyboardButton(text="💬 View in Web", url=link)]])
with io.BytesIO(str.encode(output)) as out_file: with io.BytesIO(str.encode(output)) as out_file:
out_file.name = "MissKaty_Mediainfo.txt" out_file.name = "MissKaty_Mediainfo.txt"
await message.reply_document( await message.reply_document(