示例#1
0
 public void GetChat() //消息接收并判断是否响应
 {
     try
     {
         //获取第二个字符开始到空格为止的PCR命令
         PCRGuildCommand = PCRGuildEventArgs.Message.Text.Substring(1).Split(' ')[0];
         //获取指令类型
         PCRGuildCmd.PCRGuildCommands.TryGetValue(PCRGuildCommand, out PCRGuildCmdType commandType);
         ConsoleLog.Debug("Guild Command", $"user={PCRGuildEventArgs.FromQQ.Id} command={commandType}");
         this.CommandType = commandType;
         //未知指令
         if (CommandType == 0)
         {
             GetUnknowCommand(PCRGuildEventArgs);
             ConsoleLog.Info("PCR公会管理", CommandType == 0 ? "解析到未知指令" : $"解析指令{CommandType}");
             return;
         }
         //公会管理指令
         if (CommandType > 0 && (int)CommandType < 100)
         {
             PCRHandler.GuildMgrResponse(Sender, PCRGuildEventArgs, CommandType);
         }
         //出刀管理指令
         else if ((int)CommandType > 100 && (int)CommandType < 200)
         {
             GuildBattleManager battleManager = new GuildBattleManager(PCRGuildEventArgs, CommandType);
             battleManager.GuildBattleResponse();
         }
     }
     catch (Exception e)
     {
         //命令无法被正确解析
         ConsoleLog.Error("PCR公会管理", $"指令解析发生错误\n{e}");
     }
 }
 public void GetChat() //消息接收并判断是否响应
 {
     try
     {
         //获取第二个字符开始到空格为止的PCR命令
         PCRGuildCommand = PCRGuildEventArgs.Message.RawText.Substring(1).Split(' ')[0];
         //公会管理指令
         if (CommandType > 0 && (int)CommandType < 100)
         {
             GuildManager guildManager = new GuildManager(PCRGuildEventArgs, CommandType);
             guildManager.GuildManagerResponse();
         }
         //出刀管理指令
         else if ((int)CommandType > 100 && (int)CommandType < 200)
         {
             GuildBattleManager battleManager = new GuildBattleManager(PCRGuildEventArgs, CommandType);
             battleManager.GuildBattleResponse();
         }
     }
     catch (Exception e)
     {
         //命令无法被正确解析
         ConsoleLog.Error("PCR公会管理", $"指令解析发生错误\n{e}");
     }
 }
 public void GetChat() //消息接收并判断是否响应
 {
     try
     {
         //公会管理指令
         if (CommandType > 0 && (int)CommandType < 100)
         {
             GuildManager guildManager = new GuildManager(PCRGuildEventArgs, CommandType);
             guildManager.GuildManagerResponse();
         }
         //出刀管理指令
         else if ((int)CommandType > 100 && (int)CommandType < 200)
         {
             GuildBattleManager battleManager = new GuildBattleManager(PCRGuildEventArgs, CommandType);
             battleManager.GuildBattleResponse();
         }
     }
     catch (Exception e)
     {
         //命令无法被正确解析
         Log.Error("PCR公会管理", $"指令解析发生错误\n{e}");
     }
 }