public ManageCustomCommand(IConfiguration configuration, IRepository <CustomCommand> customCommandRepository, IList <ContinuedCommand> continuedCommands, DiscordGuildMessageContext msgContext) { _customCommandRepository = customCommandRepository; _continuedCommands = continuedCommands; _msgContext = msgContext; _prefix = configuration["CommandPrefix"].Single(); }
public ContinuedCommand(Func <IServiceProvider, Task> command, DiscordGuildMessageContext context) { Command = command; CreatedAt = DateTime.UtcNow; User = context.Author; Channel = context.Channel; Guild = context.Guild; }
public HelpCommand(CommandCache commandCache, RoleService roleService, IRepository <CustomCommand> customCommandRepository, IConfiguration configuration, DiscordGuildMessageContext msgContext) { _commandCache = commandCache; _roleService = roleService; _customCommandRepository = customCommandRepository; _msgContext = msgContext; _prefix = configuration["CommandPrefix"].Single(); }
public CmdService(IConfiguration configuration, BotDbContext context, CommandCache commandCache, RoleService roleService, ILogger <CmdService> logger, IServiceProvider serviceProvider, DiscordGuildMessageContext msgContext, IRepository <CustomCommand> customCommandRepository) { _context = context; _commandCache = commandCache; _roleService = roleService; _logger = logger; _msgContext = msgContext; _customCommandRepository = customCommandRepository; _prefix = configuration["CommandPrefix"].Single(); var commands = new List <ICommand>(); var commandTypes = _commandCache.GetTypes(); foreach (var type in commandTypes) { var service = (ICommand)serviceProvider.GetRequiredService(type); commands.Add(service); } _commands = commands; }
public SetMotdCommand(IList <ContinuedCommand> continuedCommands, DiscordGuildMessageContext msgContext) { _continuedCommands = continuedCommands; _msgContext = msgContext; }
public bool Match(DiscordGuildMessageContext context) { return(context.Author.Id == User.Id && context.Channel.Id == Channel.Id && context.Guild.Id == Guild.Id); }