From 1736012d661e91b053d48ebacde7f515c7e5099e Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Sun, 2 Apr 2017 03:09:18 +0200 Subject: [PATCH] Improve mention handling. Less code = better. --- bottools/methods.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/bottools/methods.py b/bottools/methods.py index f5e8191..0a16816 100644 --- a/bottools/methods.py +++ b/bottools/methods.py @@ -345,16 +345,7 @@ def reply(bot, update, args): else: mentions = [] - if ("@%s" % sender.strip("@") != "@%s" % two.whoami().strip("@")) and not ("@%s" % sender.strip("@")) in [("@%s" % a.strip("@")) for a in args]: - first = ["@%s" % sender.strip("@")] - else: - try: - first = [mentions[0]] - mentions.remove(mentions[0]) - except: - first = [""] - - pargs = first + mentions + args[1:] + pargs = mentions + args[1:] except: update.message.reply_text(bottools.strings.cantfind % args[0])