/// <summary> /// Initializes a new instance of the <see cref="ContextTests"/> class. /// </summary> public ContextTests() { _services = new ServiceCollection() .AddDiscordCommands() .AddCommandGroup <GroupWithContext>() .AddCommandGroup <GroupWithInteractionContext>() .AddCommandGroup <GroupWithMessageContext>() .BuildServiceProvider(); _commands = _services.GetRequiredService <CommandService>(); _contextInjection = _services.GetRequiredService <ContextInjectionService>(); }
/// <summary> /// Initializes a new instance of the <see cref="CommandResponder"/> class. /// </summary> /// <param name="commandService">The command service.</param> /// <param name="options">The command responder options.</param> /// <param name="eventCollector">The event collector.</param> /// <param name="services">The available services.</param> /// <param name="contextInjection">The injection service.</param> public CommandResponder ( CommandService commandService, IOptions <CommandResponderOptions> options, ExecutionEventCollectorService eventCollector, IServiceProvider services, ContextInjectionService contextInjection ) { _commandService = commandService; _services = services; _contextInjection = contextInjection; _eventCollector = eventCollector; _options = options.Value; }
/// <summary> /// Initializes a new instance of the <see cref="InteractionResponder"/> class. /// </summary> /// <param name="commandService">The command service.</param> /// <param name="interactionAPI">The interaction API.</param> /// <param name="eventCollector">The event collector.</param> /// <param name="services">The available services.</param> /// <param name="contextInjection">The context injection service.</param> public InteractionResponder ( CommandService commandService, IDiscordRestInteractionAPI interactionAPI, ExecutionEventCollectorService eventCollector, IServiceProvider services, ContextInjectionService contextInjection ) { _commandService = commandService; _eventCollector = eventCollector; _services = services; _contextInjection = contextInjection; _interactionAPI = interactionAPI; }
/// <inheritdoc cref="CommandResponder"/> public AmbassadorCommandResponder ( CommandService commandService, IOptions <CommandResponderOptions> options, ExecutionEventCollectorService eventCollector, IServiceProvider services, ContextInjectionService contextInjection, IOptions <TokenizerOptions> tokenizerOptions, IOptions <TreeSearchOptions> treeSearchOptions ) : base ( commandService, options, eventCollector, services, contextInjection, tokenizerOptions, treeSearchOptions ) { }