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
yzhh e4a096dd8a rewrite function
undone, just save works
2022-08-26 02:43:23 +08:00

28 lines
691 B
Python

from core.elements import MessageSession
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
@staticmethod
def get():
return ExecutionLockList._list
__all__ = ["ExecutionLockList"]