Improve mention handling. Less code = better.
This commit is contained in:
parent
a7a26059e2
commit
1736012d66
|
@ -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])
|
||||
|
|
Loading…
Reference in a new issue