static void Main(string[] args) { using (var b = new Bot()) { b.RunAsync().Wait(); } }
static void Main(string[] args) { Console.WriteLine("Discord Bot Start"); var bot = new Bot(); bot.RunAsync().GetAwaiter().GetResult(); }
static void Main() { Config.LoadConfig(); using (Bot b = new Bot()) { b.RunAsync().Wait(); } }
static async Task Main(string[] args) { var config = Functions.Functions.ReadConfig(); //TwitterTimer(); var bot = new Bot(); bot.RunAsync(config).GetAwaiter().GetResult(); }
private static void Main(string[] args) { Console.WriteLine("Starting up discordbot"); #if DEBUG Console.WriteLine("In debug mode"); #else Console.WriteLine("In release mode"); #endif Bot bot = new Bot(); while (bot.restart) { bot.RunAsync().GetAwaiter().GetResult(); if (!bot.restart) { return; } bot = new Bot(); System.Threading.Thread.Sleep(2000); } }
static void Main(string[] args) { var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); var configuration = builder.Build(); var appSettings = new AppSettings(); configuration.GetSection("AppSettings").Bind(appSettings); var services = new ServiceCollection() .AddSingleton(new DiscordSocketClient()) .AddSingleton(new CommandService()) .BuildServiceProvider(); var bot = new Bot(appSettings, services, services.GetService <DiscordSocketClient>(), services.GetService <CommandService>()); bot.RunAsync().GetAwaiter().GetResult(); }
static void Main(string[] args) { var bot = new Bot(); bot.RunAsync().GetAwaiter().GetResult(); }
public static async Task Main(string[] args) { Console.WriteLine("Hello World!"); var bot = new Bot(); await bot.RunAsync(); }