Exemple #1
0
        static void Main(string[] args)
        {
            CountdownEvent = new CountdownEvent(1);
            ConfigManager  = new ConfigManager();
            if (ConfigManager.ConfigInit() == false)
            {
                return;
            }

            if (ConfigManager.Config.SetWindowSize)
            {
                Console.SetWindowSize(76, 13);
                Console.SetBufferSize(76, 13);
            }
            Console.WriteLine(
                @"  ______  _                            _  _      _         _               " + "\n" +
                @"  |  _  \(_)                          | || |    (_)       | |              " + "\n" +
                @"  | | | | _  ___   ___  ___   _ __  __| || |     _  _ __  | | __ ___  _ __ " + "\n" +
                @"  | | | || |/ __| / __|/ _ \ | '__|/ _` || |    | || '_ \ | |/ // _ \| '__|" + "\n" +
                @"  | |/ / | |\__ \| (__| (_) || |  | (_| || |____| || | | ||   <|  __/| |   " + "\n" +
                @"  |___/  |_||___/ \___|\___/ |_|   \__,_|\_____/|_||_| |_||_|\_\\___||_|   " + "\n" +
                "\n" +
                "  V2.0.3                                                    made by noname" +
                "\n"
                );

            ServerManager = new ServerManager(ConfigManager.Config.ServerPort, CountdownEvent);
            ServerManager.Start();
            Console.WriteLine("Http REST Server Started at {0}.", ConfigManager.Config.ServerPort);
            DiscordServer = new DiscordServer(ConfigManager.Config.BotToken);
            DiscordServer.StartAsync();
            Console.WriteLine("Discord Bot Server Started.");

            Thread.Sleep(2000);
            DiscordServer.DiscordSocketClient.MessageReceived += DiscordSocketClient_MessageReceived;
            ServerManager.OnPOSTRequest += ServerManager_OnPOSTRequest;
            Console.WriteLine("DiscordLinker Started.");
            CountdownEvent.Wait();
        }