.BANCHO. .FIX. Fix /away command, add support for /away command on IRC

This commit is contained in:
Nyo
2016-11-13 12:23:45 +01:00
parent 3b150d70cd
commit c7c5528588
3 changed files with 33 additions and 10 deletions

View File

@@ -51,6 +51,7 @@ class token:
self.country = 0
self.location = [0,0]
self.awayMessage = ""
self.sentAway = []
self.matchID = -1
self.tillerino = [0,0,-1.0] # beatmap, mods, acc
self.silenceEndTime = 0
@@ -426,4 +427,17 @@ class token:
def leaveAllStreams(self):
for i in self.streams:
self.leaveStream(i)
self.leaveStream(i)
def awayCheck(self, userID):
"""
Returns True if userID doesn't know that we are away
Returns False if we are not away or if userID already knows we are away
:param userID: original sender userID
:return:
"""
if self.awayMessage == "" or userID in self.sentAway:
return False
self.sentAway.append(userID)
return True