Improve mention handling. Less code = better.

This commit is contained in:
Klaus-Uwe Mitterer 2017-04-02 03:09:18 +02:00
parent a7a26059e2
commit 1736012d66

View file

@ -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])