Пример #1
0
        public async Task MainAsync()
        {
            Decks.LoadDecks();

            client = new DiscordSocketClient();

            client.Log += Log;
            commands    = new CommandService();
            services    = new ServiceCollection()
                          .AddSingleton(client)
                          .AddSingleton <InteractiveService>()
                          .BuildServiceProvider();

            await InstallCommands();

            string token = string.Empty;

            using (StreamReader reader = new StreamReader("token"))
            {
                token = reader.ReadLine();
            }

            await client.LoginAsync(TokenType.Bot, token);

            await client.StartAsync();

            await Task.Delay(-1);
        }