async def join(session: CommandSession): is_su = False qq = int(session.event.sender['user_id']) if qq in SUPERUSERS: is_su = True # 是GM/KP if is_su: await session.send(su_cannot_join) # 获得发送者的QQ号,检查是否在游戏中,已存在发送错误,不存在则添加到playerList.json中 sender_id = session.event.user_id # 发送者的QQ号 if check_id(sender_id) is True: await session.send( str(session.event.sender['card']) + ' ' + id_found_info) return # 没找到则再寻找是否存在角色卡 if check_pc(sender_id) is not True: await session.send( str(session.event.sender['card']) + ' ' + id_pc_not_found) return # 找到角色卡则将其加入 result = join_id(sender_id) if result: await session.send( str(session.event.sender['card']) + ' ' + id_join_succeed) return await session.send('[加入游戏]' + ' ' + error_info)
async def load_ps(session: CommandSession): try: test = str(session.event.sender['card']) except Exception: await session.send('此指令为群聊指令,仅在群聊有效!') return # 获得发送者的QQ号,检查是否在游戏中,不存在发送错误 sender_id = session.event.user_id # 发送者的QQ号 if check_id(sender_id) is not True: await session.send( str(session.event.sender['card']) + ' ' + id_not_found_info) return # 在游戏中则寻找状态卡,不存在发送错误 if find_ps(sender_id) is not True: await session.send( str(session.event.sender['card']) + ' ' + id_ps_not_find) return # 存在角色卡 player_state = read_ps(sender_id) result = str(session.event.sender['card']) + 'の' + fs_format(player_state) await session.send(result) refresh_ps_card()
async def s_load_pc(session: CommandSession): # 获得发送者的QQ号,检查是否在游戏中,不存在发送错误 is_format = session.get('format') if not is_format: await session.send('./spc格式错误!./spc QQ') return # 格式正确 change_qq = session.get('change_qq') sender_id = int(change_qq) # 发送者的QQ号 # sender_id = session.event.user_id # 发送者的QQ号 if check_id(sender_id) is not True: await session.send(sender_id + ' ' + id_not_found_info) return # 在游戏中则寻找状态卡,不存在发送错误 if find_pc(sender_id) is not True: await session.send(sender_id + ' ' + id_pc_not_find) return # 存在角色卡 player_state = read_pc(sender_id) result = str(sender_id) + 'の' + f_format(player_state) await session.send(result) refresh_pc_card()
async def s_load_pp(session: CommandSession): # 获得发送者的QQ号,检查是否在游戏中,不存在发送错误 is_format = session.get('format') if not is_format: await session.send('./spp 格式错误!./spp QQ') return # 格式正确 change_qq = session.get('change_qq') sender_id = int(change_qq) # 发送者的QQ号 if check_id(sender_id) is not True: await session.send(sender_id + ' ' + id_not_found_info) return # 在游戏中则寻找状态卡,不存在发送错误 if find_pc(sender_id) is not True: await session.send(sender_id + ' ' + id_pc_not_find) return # 存在角色卡 player_pp = read_pp(sender_id) player_card = str(sender_id) # 玩家群名称(划去) result = fs_pp_format(player_card, player_pp) await session.send(result) refresh_ps_card()