From 78d81159ee831fe06ebf92c2164ce2bceeb588b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Cuevas?= Date: Wed, 17 May 2017 09:10:35 +0200 Subject: [PATCH] Added ability to reply when named --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index c43ada3..13f3c6b 100644 --- a/main.py +++ b/main.py @@ -46,7 +46,7 @@ def randomchat(bot, update): user_name = update.message.from_user.username.lower() reply = chatbot.get_response(msg) - if random.randint(0, 100) < 5: + if "te rieh" in msg or random.randint(0, 100) < 5: reply = user_name + ": " + reply bot.sendMessage(update.message.chat_id, text=reply)