unbloat-code
This commit is contained in:
16
bot/talking.py
Normal file
16
bot/talking.py
Normal file
@@ -0,0 +1,16 @@
|
||||
class TalkingStick:
|
||||
def __init__(self):
|
||||
self.chat_by_talking = dict()
|
||||
self.talking_by_chat = dict()
|
||||
|
||||
def holder(self, cid):
|
||||
return self.talking_by_chat[cid]
|
||||
|
||||
def take(self, uid, cid):
|
||||
self.chat_by_talking[uid] = cid
|
||||
self.talking_by_chat[cid] = uid
|
||||
|
||||
def aho(self, uid):
|
||||
cid = self.chat_by_talking[uid]
|
||||
del self.talking_by_chat[cid]
|
||||
del self.chat_by_talking[uid]
|
Reference in New Issue
Block a user