Last active
June 30, 2018 09:28
-
-
Save DimasInchidi/60c757a6ed211b39f9836386e65cf41c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
replied = set() | |
@client.on(events.NewMessage) | |
async def greet(event: events.NewMessage.Event): | |
chat_room = await client.get_entity(event.chat_id) | |
if event.message.is_group and not event.message.from_id in replied: | |
sender = await event.message.get_sender() | |
text = 'hi' | |
replied.add(event.message.from_id) | |
await client.send_message(chat_room, text) | |
await client.send_message( | |
await client.get_entity(inchidi_id), | |
f'''Replying to user with id {sender.id} in | |
group {chat_room.title}: {text}''' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment