From 34c00405ec33b00172ad948eafc9f668083d6166 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 2 Sep 2018 20:40:17 +0300 Subject: [PATCH] Add separate offtopic message for @TelethonOffTopic --- telethon_examples/assistant.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/telethon_examples/assistant.py b/telethon_examples/assistant.py index 77adf08f..c55fc401 100644 --- a/telethon_examples/assistant.py +++ b/telethon_examples/assistant.py @@ -61,10 +61,13 @@ SPAM = ( "welcome here." ) -OFFTOPIC = ( +OFFTOPIC = { +-1001109500936: 'That is not related to Telethon. ' 'You may continue the conversation in @TelethonOffTopic' -) +-1001200633650: + 'That seems to be related to Telethon. Try asking in @TelethonChat' +} ASK = ( "Hey, that's not how you ask a question! If you want helpful advice " @@ -226,7 +229,7 @@ async def handler(event): """#ot, #offtopic: Tells the user to move to @TelethonOffTopic.""" await asyncio.wait([ event.delete(), - event.respond(OFFTOPIC, reply_to=event.reply_to_msg_id) + event.respond(OFFTOPIC[event.chat_id], reply_to=event.reply_to_msg_id) ])