コード例 #1
0
ファイル: CommandService.cs プロジェクト: ImportTaste/Nekobot
        public CommandService(CommandServiceConfig config, Func <IMessageChannel, bool> getNsfwFlag = null, Func <IVoiceState, bool> getMusicFlag = null, Func <IMessageChannel, IUser, bool> getIgnoredChannelFlag = null)
        {
            Config = config;

            _getNsfwFlag           = getNsfwFlag;
            _getMusicFlag          = getMusicFlag;
            _getIgnoredChannelFlag = getIgnoredChannelFlag;
            _allCommands           = new List <Command>();
            _map        = new CommandMap();
            _categories = new Dictionary <string, CommandMap>();
            Root        = new CommandGroupBuilder(this);
        }
コード例 #2
0
 public static DiscordClient UsingCommands(this DiscordClient client, CommandServiceConfig config = null, Func <Channel, bool> getNsfwFlag = null, Func <User, bool> getMusicFlag = null, Func <Channel, User, bool> getIgnoredChannelFlag = null)
 {
     client.AddService(new CommandService(config, getNsfwFlag, getMusicFlag, getIgnoredChannelFlag));
     return(client);
 }