示例#1
0
 static void Main(string[] args)
 {
     using (var b = new Bot())
     {
         b.RunAsync().Wait();
     }
 }
示例#2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Discord Bot Start");

            var bot = new Bot();

            bot.RunAsync().GetAwaiter().GetResult();
        }
示例#3
0
 static void Main()
 {
     Config.LoadConfig();
     using (Bot b = new Bot())
     {
         b.RunAsync().Wait();
     }
 }
示例#4
0
        static async Task Main(string[] args)
        {
            var config = Functions.Functions.ReadConfig();

            //TwitterTimer();

            var bot = new Bot();

            bot.RunAsync(config).GetAwaiter().GetResult();
        }
示例#5
0
        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);
            }
        }
示例#6
0
        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();
        }
示例#7
0
        static void Main(string[] args)
        {
            var bot = new Bot();

            bot.RunAsync().GetAwaiter().GetResult();
        }
示例#8
0
 public static async Task Main(string[] args)
 {
     Console.WriteLine("Hello World!");
     var bot = new Bot();
     await bot.RunAsync();
 }