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 }); } }
public CommandsPlugin(IBot bot, CommandProcessorConfiguration config) { AttachedBot = bot; CommandProcessor processor = new CommandProcessor(config); processors.Add(processor); }
public CommandProcessor(CommandProcessorConfiguration config) { _prefixes.Add(new Prefix(config.DefaultPrefix)); if (config.AutoSearchForCommands) { CommandSeeker s = new CommandSeeker(); hierarchyRoot = s.GetCommandsFromAttributeAsync(); cachedCommands = hierarchyRoot.GetAllEntitiesOf <Command>(); } }