mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-Nonebot.git
synced 2026-04-01 22:04:51 +00:00
临时修复私聊ai相关功能
This commit is contained in:
parent
31dad06b40
commit
266e7f695f
1 changed files with 11 additions and 0 deletions
|
|
@ -19,6 +19,8 @@ with open(os.getcwd() + '/src/ai_chat/config/chat_ai.yaml', 'r', encoding='utf-8
|
||||||
t1 = on_command("管理员注册", rule=to_me(), priority=10, block=True)
|
t1 = on_command("管理员注册", rule=to_me(), priority=10, block=True)
|
||||||
@t1.handle()
|
@t1.handle()
|
||||||
async def handle_function(message: MessageEvent):
|
async def handle_function(message: MessageEvent):
|
||||||
|
if not hasattr(message, 'group_openid'):
|
||||||
|
await t1.finish("暂未在当前场景下开放此功能。")
|
||||||
|
|
||||||
member_openid, group_openid = message.author.id, message.group_openid
|
member_openid, group_openid = message.author.id, message.group_openid
|
||||||
password = message.get_plaintext().replace("/管理员注册", "").strip()
|
password = message.get_plaintext().replace("/管理员注册", "").strip()
|
||||||
|
|
@ -33,6 +35,9 @@ t3 = on_command("开启ai",aliases={"关闭ai"},rule=to_me(),priority=10,block=T
|
||||||
@t3.handle()
|
@t3.handle()
|
||||||
async def handle_function(message: MessageEvent):
|
async def handle_function(message: MessageEvent):
|
||||||
|
|
||||||
|
if not hasattr(message, 'group_openid'):
|
||||||
|
await t3.finish("暂未在当前场景下开放此功能。")
|
||||||
|
|
||||||
member_openid, group_openid, content = message.author.id, message.group_openid, message.get_plaintext()
|
member_openid, group_openid, content = message.author.id, message.group_openid, message.get_plaintext()
|
||||||
# 判断是否为管理员
|
# 判断是否为管理员
|
||||||
if not await GroupChatRole.get_admin_list(group_openid, member_openid):
|
if not await GroupChatRole.get_admin_list(group_openid, member_openid):
|
||||||
|
|
@ -55,6 +60,9 @@ tt = on_command("角色列表", rule=to_me(), priority=10, block=True)
|
||||||
@tt.handle()
|
@tt.handle()
|
||||||
async def handle_function(message: MessageEvent):
|
async def handle_function(message: MessageEvent):
|
||||||
|
|
||||||
|
if not hasattr(message, 'group_openid'):
|
||||||
|
await tt.finish("暂未在当前场景下开放此功能。")
|
||||||
|
|
||||||
member_openid, group_openid = message.author.id, message.group_openid
|
member_openid, group_openid = message.author.id, message.group_openid
|
||||||
if not await GroupChatRole.get_admin_list(group_openid, member_openid):
|
if not await GroupChatRole.get_admin_list(group_openid, member_openid):
|
||||||
await tt.finish("您没有权限使用此功能。")
|
await tt.finish("您没有权限使用此功能。")
|
||||||
|
|
@ -69,6 +77,9 @@ t2 = on_command("添加人设",aliases={"更新人设","删除人设","切换人
|
||||||
@t2.handle()
|
@t2.handle()
|
||||||
async def handle_function(message: MessageEvent):
|
async def handle_function(message: MessageEvent):
|
||||||
|
|
||||||
|
if not hasattr(message, 'group_openid'):
|
||||||
|
await t3.finish("暂未在当前场景下开放此功能。")
|
||||||
|
|
||||||
member_openid, group_openid = message.author.id, message.group_openid
|
member_openid, group_openid = message.author.id, message.group_openid
|
||||||
if not await GroupChatRole.get_admin_list(group_openid, member_openid):
|
if not await GroupChatRole.get_admin_list(group_openid, member_openid):
|
||||||
await t2.finish("您没有权限使用此功能。")
|
await t2.finish("您没有权限使用此功能。")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue