unbloat-code

This commit is contained in:
2024-01-07 12:19:46 +03:00
parent f181f68078
commit a80727e97f
24 changed files with 179 additions and 975 deletions

16
bot/talking.py Normal file
View 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]