Improve mention handling. Less code = better.
This commit is contained in:
parent
a7a26059e2
commit
1736012d66
1 changed files with 1 additions and 10 deletions
|
@ -345,16 +345,7 @@ def reply(bot, update, args):
|
||||||
else:
|
else:
|
||||||
mentions = []
|
mentions = []
|
||||||
|
|
||||||
if ("@%s" % sender.strip("@") != "@%s" % two.whoami().strip("@")) and not ("@%s" % sender.strip("@")) in [("@%s" % a.strip("@")) for a in args]:
|
pargs = mentions + args[1:]
|
||||||
first = ["@%s" % sender.strip("@")]
|
|
||||||
else:
|
|
||||||
try:
|
|
||||||
first = [mentions[0]]
|
|
||||||
mentions.remove(mentions[0])
|
|
||||||
except:
|
|
||||||
first = [""]
|
|
||||||
|
|
||||||
pargs = first + mentions + args[1:]
|
|
||||||
|
|
||||||
except:
|
except:
|
||||||
update.message.reply_text(bottools.strings.cantfind % args[0])
|
update.message.reply_text(bottools.strings.cantfind % args[0])
|
||||||
|
|
Loading…
Reference in a new issue