Exemplo n.º 1
0
        public static MasterConfig Setup()
        {
            Console.Write("Token: ");
            string Token = Console.ReadLine();

            Console.Write("MongoDB User: "******"MongoDB Pass: ");
            string MongoPass = Console.ReadLine();

            MasterConfig Config = new MasterConfig(Token, MongoUser, MongoPass);

            return(Config);
        }
Exemplo n.º 2
0
        async Task Execute()
        {
            Console.WriteLine("Starting Note to Self Bot v1.1 ...");

            MasterConfig Config = MasterConfig.Load();

            if (Config == null)
            {
                Config = MasterConfig.Setup();
            }

            Config.Save();

            Notes = new NotesManager(Config.MongoUser, Config.MongoPass);

            DiscordSocketConfig ClientConfig = new DiscordSocketConfig()
            {
                DefaultRetryMode = RetryMode.AlwaysFail,
                LogLevel         = LogSeverity.Info
            };
            CommandServiceConfig CommandConfig = new CommandServiceConfig()
            {
                DefaultRunMode = RunMode.Async
            };

            Client  = new DiscordShardedClient(ClientConfig);
            Command = new CommandService(CommandConfig);

            await InitializeCommands();

            Client.Log += (msg) => Log(msg);

            await Client.LoginAsync(TokenType.Bot, Config.Token);

            await Client.StartAsync();

            await Task.Delay(-1);
        }