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/core/elements/temp/__init__.py

33 lines
727 B
Python
Raw Normal View History

2021-10-22 13:24:09 +00:00
from core.elements import MessageSession
2021-10-20 14:04:30 +00:00
2023-02-04 14:42:21 +00:00
class Temp:
data = {}
2021-10-22 13:24:09 +00:00
class ExecutionLockList:
_list = set()
@staticmethod
def add(msg: MessageSession):
targetId = msg.target.senderId
ExecutionLockList._list.add(targetId)
@staticmethod
def remove(msg: MessageSession):
targetId = msg.target.senderId
if targetId in ExecutionLockList._list:
ExecutionLockList._list.remove(targetId)
@staticmethod
def check(msg: MessageSession):
targetId = msg.target.senderId
return True if targetId in ExecutionLockList._list else False
2021-10-14 15:29:45 +00:00
2022-06-20 13:49:11 +00:00
@staticmethod
def get():
return ExecutionLockList._list
2021-10-14 15:29:45 +00:00
2023-02-04 14:42:21 +00:00
__all__ = ["Temp", "ExecutionLockList"]