Hey again,
Im using telethon-sync by importing sync like this: from telethon import sync, TelegramClient, events
But when i run event it errors again: RuntimeWarning: coroutine 'send_message' was never awaited
Wtf i must do with this?! At least tell me what version is not using asyncio to i use that?!:|
my code:
client = TelegramClient('TelegramPySession', api_id, api_hash)
client.start()
@client.on(events.NewMessage(incoming=True, pattern='b'))
def blocking(event):
text = 'hello'
client.send_message(entity=event.chat_id, message=text, parse_mode='markdown')
client.run_until_disconnected()
Im reading doc but not finding my answer :|
I can use async and its working but since that im running two clients with telethon (one just using methods by flask and one listening for new message) When i using none async methods, async listener turned off and not working any more until restart the server!
You are doing it wrong, and in the documentation you won't see def blocking. Honestly either read the documentation or give up with async:
pip uninstall telethon
pip install telethon-sync
This isn't the place to ask. This is for ISSUES with the library, not your code.
Please read my issue again, Im importing sync and installed telethon-sync! but it not working!
Because telethon.sync has no effect with updates and that's explained very clearly in both the documentation and the pinned message over @TelethonChat.
@telethonchat not found in telegram!
Then you may be banned from using public groups because I'm in it.
Can u invite me? @Katerou22
@Katerou22 "Sorry, you can only add mutual contacts at the moment."
wtf, Im not ban from public groups! im in other groups now but @telethonchat not found error!
I used another phone number and client, Still not found!
I'll give u my number in pv telegram!
@Katerou22 don't. I don't want it.
Are u sure the id is correct?!
@Katerou22 yes.
@Lonami the telethon-sync does not exist:
ERROR: Could not find a version that satisfies the requirement telethon-sync (from versions: none) ERROR: No matching distribution found for telethon-sync
I'm aware. I removed the package because it was a hack I did not want to maintain, and people really should not use it as it was.
Most helpful comment
You are doing it wrong, and in the documentation you won't see
def blocking. Honestly either read the documentation or give up with async:This isn't the place to ask. This is for ISSUES with the library, not your code.