Improve mention handling. Yet again.
This commit is contained in:
parent
b63a5b966d
commit
a4c560baf2
1 changed files with 5 additions and 1 deletions
|
@ -323,6 +323,10 @@ def explicitTweet(bot, update, args, reply = None):
|
||||||
|
|
||||||
def getMentions(tweet, two, args = []):
|
def getMentions(tweet, two, args = []):
|
||||||
sender = tweet.user.screen_name
|
sender = tweet.user.screen_name
|
||||||
|
|
||||||
|
if "@%s" % sender.strip("@") in args:
|
||||||
|
return []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
text = tweet.full_text
|
text = tweet.full_text
|
||||||
except:
|
except:
|
||||||
|
@ -337,7 +341,7 @@ def getMentions(tweet, two, args = []):
|
||||||
except:
|
except:
|
||||||
pass
|
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
|
mentions = ["@%s" % sender.strip("@")] + mentions
|
||||||
|
|
||||||
return mentions
|
return mentions
|
||||||
|
|
Loading…
Reference in a new issue