LonamiWebs / Telethon

Pure Python 3 MTProto API Telegram client library, for bots too!
https://docs.telethon.dev
MIT License
9.68k stars 1.38k forks source link

Reply to message only from users #1490

Closed ibimo closed 4 years ago

ibimo commented 4 years ago

Im using this code and it work, the problem is: The userbot respond/reply to messages from groups too, how i can avoid this?

`from telethon import TelegramClient, events

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

@client.on(events.NewMessage) async def my_event_handler(event): if 'hello' in event.raw_text: await event.reply('hi!')

client.start() client.run_until_disconnected()`

Lonami commented 4 years ago

Hi, this is not an issue with the library but rather a question. The issues section in GitHub is only to report bugs or enhancements in the library itself. If you have usage questions, you should ask those in StackOverflow or the @TelethonChat group.