skip to Main Content

RuntimeWarning: coroutine 'MessageMethods.send_message' was never awaited – Telegram API

import random from telethon import TelegramClient, events def main(): api_id = 9123640 api_hash = '8as6fgvs8t9ar76fse89rgearz' chat = '@username' message = 'hi' client = TelegramClient('afewfe', api_id, api_hash) @client.on(events.NewMessage(chats=chat)) async def normal_handler(event): if event.message.button_count == 4: await event.message.click(random.randint(0, 3)) await client.disconnect() client.start()…

VIEW QUESTION

Sending the output of Prettytable to Telegram – Telegram API

I have the following code: from prettytable import PrettyTable myTable = PrettyTable(["Student Name", "Class", "Section", "Percentage"]) # Add rows myTable.add_row(["Leanord", "X", "B", "91.2 %"]) myTable.add_row(["Penny", "X", "C", "63.5 %"]) myTable.add_row(["Howard", "X", "A", "90.23 %"]) myTable.add_row(["Bernadette", "X", "D", "92.7 %"]) myTable.add_row(["Sheldon",…

VIEW QUESTION

socket.timeout on telegram bot.polling() – Telegram API

When I leave my program running for a few hours and then send a message to the bot it doesn't reply and after a while it generates the following error. Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/connectionpool.py", line 445, in…

VIEW QUESTION
Back To Top
Search