加入bot,自动注入内容,在项目启动完成之后,给每个插件注入bot

This commit is contained in:
liuwei
2025-05-20 15:10:26 +08:00
parent 322297a69c
commit da89eea4f1
6 changed files with 69 additions and 53 deletions

View File

@@ -46,7 +46,6 @@ class GameTaskPlugin(MessagePluginInterface):
def __init__(self):
super().__init__()
self.LOG = logger
self.bot: WechatAPIClient = None
async_job.at_times(["14:43"])(self.run_random_task_assignment)
def initialize(self, context: Dict[str, Any]) -> bool:
@@ -117,7 +116,6 @@ class GameTaskPlugin(MessagePluginInterface):
gbm: GroupBotManager = message.get("gbm")
all_contacts = message.get("all_contacts", {})
self.bot: WechatAPIClient = message.get("bot")
self.LOG.debug(f"插件执行: {self.name}{content}")
# 检查权限