Skip to content

Commit

Permalink
合并拉取请求 #64
Browse files Browse the repository at this point in the history
缩短get_login_code命令
  • Loading branch information
Cypas authored Mar 28, 2024
2 parents 0edddef + 98b1bf0 commit 0971d52
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions nonebot_plugin_splatoon3_nso/handle/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async def login_in(bot: Bot, event: Event, matcher: Matcher):
# 发送md
await bot_send_login_md(bot, event, user_id)
else:
msg = "QQ平台当前无法完成nso登录流程,请至其他平台完成登录后使用/get_login_code命令获取绑定码\n" \
msg = "QQ平台当前无法完成nso登录流程,请至其他平台完成登录后使用/getlc命令获取绑定码\n" \
f"Kook服务器id:{plugin_config.splatoon3_kk_guild_id}"
await bot_send(bot, event, msg)

Expand Down Expand Up @@ -126,7 +126,8 @@ async def login_in_2(bot: Bot, event: Event):
event_info = await get_event_info(bot, event)
user_name = event_info.get('user_name', "")
# 更新数据库
user = dict_get_or_set_user_info(platform, user_id, session_token=session_token, user_name=user_name, user_agreement=1)
user = dict_get_or_set_user_info(platform, user_id, session_token=session_token, user_name=user_name,
user_agreement=1)
# 刷新token
await bot.send(event, message="登录中,正在刷新token,请等待大约10s")
splatoon = Splatoon(bot, event, user)
Expand Down Expand Up @@ -195,7 +196,8 @@ async def clear_db_info(bot: Bot, event: Event):
await bot_send(bot, event, message=msg)


@on_command("get_login_code", priority=10, block=True).handle(parameterless=[Depends(_check_session_handler)])
@on_command("get_login_code", aliases={'getlogincode', 'glc', 'getlc'}, priority=10, block=True).handle(
parameterless=[Depends(_check_session_handler)])
async def get_login_code(bot: Bot, event: Event):
"""获取绑定码"""
if isinstance(event, QQ_GME):
Expand Down
2 changes: 1 addition & 1 deletion nonebot_plugin_splatoon3_nso/handle/qq_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def login_md(user_id, check_session=False) -> QQ_Msg:
data1 = ""
if check_session:
data1 += "nso未登录,无法使用相关查询,"
data1 += "QQ平台当前无法完成登录流程,请至其他平台完成登录后使用/get_login_code命令获取绑定码"
data1 += "QQ平台当前无法完成登录流程,请至其他平台完成登录后使用 /getlc 命令获取绑定码"
data2 = f"Kook服务器id:{plugin_config.splatoon3_kk_guild_id}"
button_show = "kook服务器"
kook_jump_link = "https://www.kookapp.cn/app/invite/mkjIOn"
Expand Down
2 changes: 1 addition & 1 deletion nonebot_plugin_splatoon3_nso/handle/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async def _check_session_handler(bot: Bot, event: Event, matcher: Matcher):
await matcher.finish()
else:
msg = "nso未登录,无法使用相关查询\n" \
"QQ平台当前无法完成nso登录流程,请至其他平台完成登录后使用/get_login_code命令获取绑定码\n" \
"QQ平台当前无法完成nso登录流程,请至其他平台完成登录后使用/getlc命令获取绑定码\n" \
f"Kook服务器id:{plugin_config.splatoon3_kk_guild_id}"
elif isinstance(bot, All_BOT):
msg = "nso未登录,无法使用相关查询,请先私信我 /login 进行登录"
Expand Down

0 comments on commit 0971d52

Please sign in to comment.