Skip to content

Commit

Permalink
🐛 修复无法使用 at 和 平台 ID 查询信息的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
KomoriDev committed Aug 1, 2024
1 parent 840cc89 commit 52e6113
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nonebot_plugin_wakatime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
require("nonebot_plugin_user")
require("nonebot_plugin_alconna")
require("nonebot_plugin_htmlrender")
from nonebot_plugin_user import UserSession
from nonebot_plugin_orm import async_scoped_session
from nonebot_plugin_user import UserSession, get_user
from nonebot_plugin_alconna.uniseg import At, Button, UniMessage, FallbackStrategy
from nonebot_plugin_alconna import Args, Match, Option, Alconna, MsgTarget, on_alconna

Expand Down Expand Up @@ -77,10 +77,11 @@ async def _(user_session: UserSession, target: Match[At | int]):
if target.available:
if isinstance(target.result, At):
target_name = "他"
target_id = target.result.target
target_platform_id = target.result.target
else:
target_name = "他"
target_id = target.result
target_platform_id = target.result
target_id = (await get_user(user_session.platform, target_platform_id)).id
else:
target_name = "你"
target_id = user_session.user_id
Expand Down

0 comments on commit 52e6113

Please sign in to comment.