feat✨: Ai

This commit is contained in:
HibiKier
2024-03-09 23:42:59 +08:00
parent 5a50a2bff4
commit 960b665ba4
5 changed files with 542 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
from nonebot.internal.params import Depends
from nonebot.params import Command
from nonebot_plugin_userinfo import EventUserInfo, UserInfo
def OneCommand():
"""
获取单个命令Command
"""
async def dependency(
cmd: tuple[str, ...] = Command(),
):
return cmd[0] if cmd else None
return Depends(dependency)
def UserName():
"""
用户名称
"""
async def dependency(user_info: UserInfo = EventUserInfo()):
return (
user_info.user_displayname or user_info.user_remark or user_info.user_name
)
return Depends(dependency)