public static async Task Main(string[] args) { Client.Check(); ValourClient.BotPrefix = "/"; await ValourClient.Start(Client.Config.Email, Client.Config.BotPassword); ValourClient.RegisterModules(); ValourClient.OnMessage += async(message) => { await OnMessageRecieve(message); }; Console.WriteLine("Hello World!"); foreach (Lottery lottery in Context.Lotteries) { lotterycache.Add(lottery.PlanetId, lottery); } Task task = Task.Run(async() => UpdateHourly(Client.DBContext)); while (true) { Console.ReadLine(); } }
static async Task Main() { using FileStream openStream = File.OpenRead("config.json"); Config config = await System.Text.Json.JsonSerializer.DeserializeAsync <Config>(openStream); ValourClient.BotPrefix = config.CommandSign; await ValourClient.Start(config.Email, config.BotPassword); ValourClient.RegisterModules(); await Task.Delay(-1); }