I reactivated a "old" bot and get this error:
telethon\utils.py", line 138, in _raise_cast_fail
raise TypeError('Cannot cast {} to any kind of {}.'.format(
TypeError: Cannot cast coroutine to any kind of Peer.
After some trying... I found out that this error occures when I do whitelist chats in the functions:
@bot.on(events.NewMessage(chats=bot.get_entity(config_group),pattern='/hello'))
async def hello(event):
My work around is:
@bot.on(events.NewMessage(pattern='/hello'))
async def hello(event):
if int(event.chat_id) == int(config_group):
It works but for how long? Im wondering if I do something wrong? (I mean at the whitelist parameter the function isnt awaited - if that is the reason) But it works one week ago so ...
Thanks if you can help :)