Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/bots/discord/tasks.py
2022-06-17 13:59:15 +08:00

30 lines
628 B
Python

class MessageTaskManager:
_list = {}
@staticmethod
def add_task(grp, uid, tsk):
MessageTaskManager._list.update({grp: {uid: tsk}})
@staticmethod
def del_task(grp, uid):
del MessageTaskManager._list[grp][uid]
@staticmethod
def get():
return MessageTaskManager._list
class FinishedTasks:
_list = {}
@staticmethod
def add_task(grp, uid, result):
FinishedTasks._list.update({grp: {uid: result}})
@staticmethod
def del_task(grp, uid):
del FinishedTasks._list[grp][uid]
@staticmethod
def get():
return FinishedTasks._list