diff --git a/misskaty/plugins/paste.py b/misskaty/plugins/paste.py index 7e9b521d..a6199b25 100644 --- a/misskaty/plugins/paste.py +++ b/misskaty/plugins/paste.py @@ -431,10 +431,12 @@ async def imgbb_upload(_, message): uname = message.sender_chat.title try: + path = await reply.download() data = {"type": "file", "action": "upload"} files = {"source": (path, open(path, "rb"), "images/jpeg")} headers = {"origin": "https://imgbb.com", "referer": "https://imgbb.com/upload", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.42"} res = await fetch.post("https://imgbb.com/json", files=files, data=data, headers=headers) + remove(path) url = res.json()["image"]["url"] button = [ [InlineKeyboardButton("Open Link", url=url)],