Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
MeetWq committed Feb 25, 2024
1 parent f152b0d commit f48f182
Show file tree
Hide file tree
Showing 3 changed files with 424 additions and 322 deletions.
16 changes: 14 additions & 2 deletions nonebot_plugin_session_saa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
TargetKaiheilaPrivate,
TargetOB12Unknow,
TargetQQGroup,
TargetQQGroupOpenId,
TargetQQGuildChannel,
TargetQQGuildDirect,
TargetQQPrivate,
TargetQQPrivateOpenId,
TargetTelegramCommon,
TargetTelegramForum,
)
Expand All @@ -41,9 +43,19 @@
def get_saa_target(session: Session) -> Optional[PlatformTarget]:
if session.platform == SupportedPlatform.qq:
if session.level == SessionLevel.LEVEL1 and session.id1:
return TargetQQPrivate(user_id=int(session.id1))
if session.id1.isdigit():
return TargetQQPrivate(user_id=int(session.id1))
else:
return TargetQQPrivateOpenId(
bot_id=session.bot_id, user_openid=session.id1
)
elif session.level == SessionLevel.LEVEL2 and session.id2:
return TargetQQGroup(group_id=int(session.id2))
if session.id2.isdigit():
return TargetQQGroup(group_id=int(session.id2))
else:
return TargetQQGroupOpenId(
bot_id=session.bot_id, group_openid=session.id2
)

elif session.platform == SupportedPlatform.qqguild:
if session.level == SessionLevel.LEVEL1:
Expand Down
Loading

0 comments on commit f48f182

Please sign in to comment.