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
1 changed files with 2 additions and 2 deletions

View File

@ -208,13 +208,13 @@ def reply(bot, update, args):
for m in re.split('[^\w@]+', otweet.text):
try:
if m[0] == "@":
if m[0] == "@" and m[0].strip() != "":
mentions += [m]
except:
pass
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)
else: