MCPcopy Create free account
hub / github.com/Loping151/RoverSign / _handle_pgr_switch

Function _handle_pgr_switch

RoverSign/roversign_config/__init__.py:100–111  ·  view source on GitHub ↗
(bot: Bot, ev: Event)

Source from the content-addressed store, hash-verified

98
99
100async def _handle_pgr_switch(bot: Bot, ev: Event):
101 at_sender = True if ev.group_id else False
102 pgr_uid = await WavesBind.get_uid_by_game(ev.user_id, ev.bot_id, game_name="pgr")
103 if pgr_uid is None:
104 msg = "您还未绑定战双特征码!"
105 return await bot.send((" " if at_sender else "") + msg, at_sender)
106
107 logger.info(f"[库洛签到·配置] user_id={ev.user_id} 尝试[{ev.command[0:2]}]了[{ev.text}]功能")
108
109 im = await set_pgr_config_func(ev, pgr_uid)
110 im = im.rstrip("\n") if isinstance(im, str) else im
111 await bot.send((" " if at_sender and isinstance(im, str) else "") + im if isinstance(im, str) else im, at_sender)

Callers 1

open_switch_funcFunction · 0.85

Calls 1

set_pgr_config_funcFunction · 0.85

Tested by

no test coverage detected