1
0
forked from bot/app

fix: pydantic数据类型错误

This commit is contained in:
远野千束 2024-03-24 13:36:28 +08:00
parent c6f65d544f
commit 5a929d3e99
2 changed files with 3 additions and 3 deletions

View File

@ -75,9 +75,9 @@ def get_plugin_session_enable(event: T_MessageEvent, plugin_module_name: str) ->
bool: 插件当前状态
"""
if event.message_type == "group":
session: GroupChat = group_db.first(GroupChat, 'group_id = ?', event.group_id, default=GroupChat(group_id=event.group_id))
session: GroupChat = group_db.first(GroupChat, 'group_id = ?', event.group_id, default=GroupChat(group_id=str(event.group_id)))
else:
session: User = user_db.first(User, 'user_id = ?', event.user_id, default=User(user_id=event.user_id))
session: User = user_db.first(User, 'user_id = ?', event.user_id, default=User(user_id=str(event.user_id)))
# 默认停用插件在启用列表内表示启用
# 默认停用插件不在启用列表内表示停用
# 默认启用插件在停用列表内表示停用

View File

@ -132,7 +132,7 @@ async def _(result: Arparma, event: T_MessageEvent, bot: T_Bot):
session = user_db.first(User, "user_id = ?", event.user_id, default=User(user_id=event.user_id))
else:
if await GROUP_ADMIN(bot, event) or await GROUP_OWNER(bot, event) or await SUPERUSER(bot, event):
session = group_db.first(GroupChat, "group_id = ?", event.group_id, default=GroupChat(group_id=event.group_id))
session = group_db.first(GroupChat, "group_id = ?", event.group_id, default=GroupChat(group_id=str(event.group_id)))
else:
raise FinishedException(ulang.get("Permission Denied"))
try: