Exemple #1
0
 public CommandHandler(IServiceProvider services, DiscordSocketClient client, CommandService commands, BotDefinition botDefinition)
 {
     _commands          = commands;
     _client            = client;
     this.services      = services;
     this.botDefinition = botDefinition;
 }
Exemple #2
0
        private bool LoadBotDefinition()
        {
            string bd = SaveLoadService.Load("botdefinition.json");

            if (bd != null)
            {
                botDefinition = JsonConvert.DeserializeObject <BotDefinition>(bd);
                try
                {
                    token = botDefinition.GetCurrent().token;
                    return(true);
                }
                catch
                {
                    return(false);
                }
            }
            return(false);
        }
Exemple #3
0
 public void AddBot(BotDefinition definition)
 {
     _bots = _bots.Append(definition).ToHashSet();
 }