Esempio n. 1
0
 public BlendoBot(string configPath)
 {
     Config            = new Config(configPath);
     StartTime         = DateTime.Now;
     Logger            = new Logger(StartTime);
     CommandManager    = new CommandManager(Logger, this);
     DiscordInteractor = new DiscordInteractor(CommandManager, Config, Logger);
 }
Esempio n. 2
0
        public async Task Start(string[] _)
        {
            if (!Config.Reload())
            {
                Console.Error.WriteLine($"Could not find {Config.ConfigPath}! A default one will be created. Please modify the appropriate fields!");
                Config.CreateDefaultConfig();
                Environment.Exit(1);
            }
            else
            {
                Console.WriteLine($"Successfully read config file: bot name is {Config.Name}");
                if (Config.ActivityType.HasValue ^ Config.ActivityName != null)
                {
                    Console.WriteLine("The config's ActivityType and ActivityName must both be present to work. Defaulting to no current activity.");
                }
            }

            CommandManager.LoadCommands();

            await DiscordInteractor.ConnectAsync();

            await Task.Delay(-1);
        }