mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-26 14:05:03 +08:00
fix: pydantic数据类型错误
This commit is contained in:
parent
c6f65d544f
commit
5a929d3e99
@ -75,9 +75,9 @@ def get_plugin_session_enable(event: T_MessageEvent, plugin_module_name: str) ->
|
|||||||
bool: 插件当前状态
|
bool: 插件当前状态
|
||||||
"""
|
"""
|
||||||
if event.message_type == "group":
|
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:
|
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)))
|
||||||
# 默认停用插件在启用列表内表示启用
|
# 默认停用插件在启用列表内表示启用
|
||||||
# 默认停用插件不在启用列表内表示停用
|
# 默认停用插件不在启用列表内表示停用
|
||||||
# 默认启用插件在停用列表内表示停用
|
# 默认启用插件在停用列表内表示停用
|
||||||
|
@ -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))
|
session = user_db.first(User, "user_id = ?", event.user_id, default=User(user_id=event.user_id))
|
||||||
else:
|
else:
|
||||||
if await GROUP_ADMIN(bot, event) or await GROUP_OWNER(bot, event) or await SUPERUSER(bot, event):
|
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:
|
else:
|
||||||
raise FinishedException(ulang.get("Permission Denied"))
|
raise FinishedException(ulang.get("Permission Denied"))
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user