mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 12:05:54 +00:00
chore: 整理代码
This commit is contained in:
@@ -29,10 +29,6 @@ class PluginOperator(operator.CommandOperator):
|
||||
plugin.plugin_version, plugin.plugin_author)
|
||||
|
||||
# TODO 从元数据调远程地址
|
||||
# if updater.is_repo("/".join(plugin['path'].split('/')[:-1])):
|
||||
# remote_url = updater.get_remote_url("/".join(plugin['path'].split('/')[:-1]))
|
||||
# if remote_url != "https://github.com/RockChinQ/QChatGPT" and remote_url != "https://gitee.com/RockChin/QChatGPT":
|
||||
# reply_str += "源码: "+remote_url+"\n"
|
||||
|
||||
idx += 1
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@ class StageProcessResult(pydantic.BaseModel):
|
||||
user_notice: typing.Optional[typing.Union[str, list[mirai_message.MessageComponent], mirai.MessageChain, None]] = []
|
||||
"""只要设置了就会发送给用户"""
|
||||
|
||||
admin_notice: typing.Optional[typing.Union[str, list[mirai_message.MessageComponent], mirai.MessageChain, None]] = []
|
||||
# TODO delete
|
||||
# admin_notice: typing.Optional[typing.Union[str, list[mirai_message.MessageComponent], mirai.MessageChain, None]] = []
|
||||
"""只要设置了就会发送给管理员"""
|
||||
|
||||
console_notice: typing.Optional[str] = ''
|
||||
@@ -37,5 +38,3 @@ class StageProcessResult(pydantic.BaseModel):
|
||||
debug_notice: typing.Optional[str] = ''
|
||||
|
||||
error_notice: typing.Optional[str] = ''
|
||||
|
||||
|
||||
|
||||
@@ -150,22 +150,23 @@ class PlatformManager:
|
||||
)
|
||||
|
||||
# 通知系统管理员
|
||||
async def notify_admin(self, message: str):
|
||||
await self.notify_admin_message_chain(MessageChain([Plain("[bot]{}".format(message))]))
|
||||
# TODO delete
|
||||
# async def notify_admin(self, message: str):
|
||||
# await self.notify_admin_message_chain(MessageChain([Plain("[bot]{}".format(message))]))
|
||||
|
||||
async def notify_admin_message_chain(self, message: mirai.MessageChain):
|
||||
if self.ap.system_cfg.data['admin-sessions'] != []:
|
||||
# async def notify_admin_message_chain(self, message: mirai.MessageChain):
|
||||
# if self.ap.system_cfg.data['admin-sessions'] != []:
|
||||
|
||||
admin_list = []
|
||||
for admin in self.ap.system_cfg.data['admin-sessions']:
|
||||
admin_list.append(admin)
|
||||
# admin_list = []
|
||||
# for admin in self.ap.system_cfg.data['admin-sessions']:
|
||||
# admin_list.append(admin)
|
||||
|
||||
for adm in admin_list:
|
||||
self.adapter.send_message(
|
||||
adm.split("_")[0],
|
||||
adm.split("_")[1],
|
||||
message
|
||||
)
|
||||
# for adm in admin_list:
|
||||
# self.adapter.send_message(
|
||||
# adm.split("_")[0],
|
||||
# adm.split("_")[1],
|
||||
# message
|
||||
# )
|
||||
|
||||
async def run(self):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user