Try to prevent empty mentions, i.e. '@'

This commit is contained in:
Klaus-Uwe Mitterer 2017-03-25 22:04:18 +01:00
parent f309a854c6
commit 2921c10fb6

View file

@ -208,13 +208,13 @@ def reply(bot, update, args):
for m in re.split('[^\w@]+', otweet.text): for m in re.split('[^\w@]+', otweet.text):
try: try:
if m[0] == "@": if m[0] == "@" and m[0].strip() != "":
mentions += [m] mentions += [m]
except: except:
pass pass
for m in mentions: for m in mentions:
if m in args or m =="@%s" % two.whoami().strip("@") or m == "@%s" % sender.strip("@"): if m in args or m.strip() == "" or m =="@%s" % two.whoami().strip("@") or m == "@%s" % sender.strip("@"):
mentions.remove(m) mentions.remove(m)
else: else: