Beispiel #1
0
        public async Task Test()
        {
            var embed = _defaultEmbedGenerator
                        .GenerateNotFoundEmbed("TestModule", "TestCommand", "Title", "Command was not found!").Build();
            await DefaultLogger.Logger(new LogMessage(LogSeverity.Error, "TestModule", "TestModule has crashed!",
                                                      new DllNotFoundException()));

            await ReplyAsync("", embed : embed);
        }
Beispiel #2
0
 private static void Tests()
 {
     DefaultLogger.Logger(new LogMessage(LogSeverity.Info, "Database", "Starting Database Check"));
     if (DatabaseManager.GetMock().Servers != null && new RiotData().Items != null)
     {
         DefaultLogger.Logger(new LogMessage(LogSeverity.Info, "Database", "Success"));
     }
     else
     {
         DefaultLogger.Logger(
             new LogMessage(LogSeverity.Critical, "Database", "Mock database failed to connect"));
         Console.ReadLine();
     }
     DefaultLogger.Logger(new LogMessage(LogSeverity.Info, "Configuration", "Checking Configuration.json file"));
     try
     {
         string t = OptionManager.DiscordKey; //Write proper test later
         DefaultLogger.Logger(new LogMessage(LogSeverity.Info, "Configuration", "Configuration verified"));
     }
     catch
     {
         DefaultLogger.Logger(new LogMessage(LogSeverity.Critical, "Configuration",
                                             "Failed to use configuration file"));
         Console.ReadLine();
     }
     DefaultLogger.Logger(new LogMessage(LogSeverity.Info, "Riot API", "Starting API Connection Check"));
     try
     {
         DefaultLogger.Logger(new LogMessage(LogSeverity.Info, "Riot API", "Requesting BortTheBeaver on EUW"));
         var riotClient = new RiotWrapper.RiotClient(OptionManager.RiotKey);
         var account    = riotClient.Summoner.GetSummonerByName("BortTheBeaver", Platforms.EUW1);
         if (account == null)
         {
             DefaultLogger.Logger(new LogMessage(LogSeverity.Critical, "Riot API",
                                                 "Failed to get a response from the API"));
             Console.ReadLine();
         }
         DefaultLogger.Logger(new LogMessage(LogSeverity.Info, "Riot API", "Riot API connection verified"));
     }
     catch
     {
         DefaultLogger.Logger(new LogMessage(LogSeverity.Critical, "Riot API",
                                             "Connection failed please check your connection string"));
         Console.ReadLine();
     }
 }