Improve mention handling. Yet again.

This commit is contained in:
Klaus-Uwe Mitterer 2017-04-06 22:43:32 +02:00
parent b63a5b966d
commit a4c560baf2
1 changed files with 5 additions and 1 deletions

View File

@ -323,6 +323,10 @@ def explicitTweet(bot, update, args, reply = None):
def getMentions(tweet, two, args = []):
sender = tweet.user.screen_name
if "@%s" % sender.strip("@") in args:
return []
try:
text = tweet.full_text
except:
@ -337,7 +341,7 @@ def getMentions(tweet, two, args = []):
except:
pass
if not sender.strip("@") == two.whoami().strip("@") and not "@%s" % sender.strip("@") in mentions:
if not (sender.strip("@") == two.whoami().strip("@") or "@%s" % sender.strip("@") in mentions):
mentions = ["@%s" % sender.strip("@")] + mentions
return mentions