Example #1
0
        public CommandProcessor(CommandProcessorConfiguration config)
        {
            this.config = config;

            if (config.AutoSearchForCommands)
            {
                CommandSeeker s = new CommandSeeker();
                hierarchyRoot  = s.GetCommandsFromAttributeAsync();
                cachedCommands = hierarchyRoot.GetAllEntitiesOf <Command>();
            }

            if (config.MentionAsPrefix)
            {
                if (config.DefaultPrefix != "")
                {
                    prefixes.Add(new Prefix(config.DefaultPrefix)
                    {
                        Configurable = config.DefaultConfigurable
                    });
                }
                prefixes.Add(new MentionPrefix());
            }
            else
            {
                prefixes.Add(new Prefix(config.DefaultPrefix)
                {
                    Configurable = config.DefaultConfigurable
                });
            }
        }
Example #2
0
        public CommandProcessor(CommandProcessorConfiguration config)
        {
            _prefixes.Add(new Prefix(config.DefaultPrefix));

            if (config.AutoSearchForCommands)
            {
                CommandSeeker s = new CommandSeeker();
                hierarchyRoot  = s.GetCommandsFromAttributeAsync();
                cachedCommands = hierarchyRoot.GetAllEntitiesOf <Command>();
            }
        }