R
R
Ruslan Mandzyuk2021-11-05 11:13:20
Python
Ruslan Mandzyuk, 2021-11-05 11:13:20

Why is get_entity not working?

from telethon import TelegramClient


api_id = 00000000
api_hash = '666666666666666666666666666'
bot_token = '7777777777777777777777777777777777777777'

client = TelegramClient('session_name', api_id, api_hash)

client.start()

c = client.get_entity('name chanel')

mistake
sys:1: RuntimeWarning: coroutine 'UserMethods.get_entity' was never awaited

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-11-05
@Ryslan_13

telethon - asynchronous. Read quick start on slip
https://docs.telethon.dev/en/latest/basic/quick-st... Well, or you can import sync
from telethon import TelegramClient, sync

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question