Beispiel #1
0
 public AuthorizationService(IServiceProvider serviceProvider, IClaimMappingRepository claimMappingRepository, ISelfUserProvider selfUserProvider)
 {
     // Workaround for circular dependency.
     _lazyUserService       = new Lazy <IUserService>(() => serviceProvider.GetRequiredService <IUserService>());
     ClaimMappingRepository = claimMappingRepository;
     SelfUserProvider       = selfUserProvider;
 }
Beispiel #2
0
 /// <summary>
 /// Constructs a new <see cref="MutePersistingHandler"/> object with the given injected dependencies.
 /// </summary>
 /// <param name="moderationService">A moderation service to interact with the infractions system.</param>
 /// <param name="selfUserProvider">The Discord user that the bot is running as.</param>
 public MutePersistingHandler(
     IModerationService moderationService,
     ISelfUserProvider selfUserProvider)
 {
     _moderationService = moderationService;
     _selfUserProvider  = selfUserProvider;
 }
Beispiel #3
0
 public MessageService(
     IDiscordSocketClient discordSocketClient,
     ISelfUserProvider selfUserProvider,
     IMessageRepository messageRepository)
 {
     _discordSocketClient = discordSocketClient;
     _selfUserProvider    = selfUserProvider;
     _messageRepository   = messageRepository;
 }
Beispiel #4
0
 /// <summary>
 /// Constructs a new <see cref="InvitePurgingBehavior"/> object, with the given injected dependencies.
 /// </summary>
 public InvitePurgingBehavior(
     IDesignatedChannelService designatedChannelService,
     IAuthorizationService authorizationService,
     IModerationService moderationService,
     ISelfUserProvider selfUserProvider)
 {
     DesignatedChannelService = designatedChannelService;
     AuthorizationService     = authorizationService;
     ModerationService        = moderationService;
     SelfUserProvider         = selfUserProvider;
 }
Beispiel #5
0
 /// <summary>
 /// Constructs a new <see cref="PromotionLoggingHandler"/> object, with injected dependencies.
 /// </summary>
 public PromotionLoggingHandler(
     IAuthorizationService authorizationService,
     IDiscordClient discordClient,
     IDesignatedChannelService designatedChannelService,
     IUserService userService,
     IPromotionsService promotionsService,
     ISelfUserProvider selfUserProvider)
 {
     AuthorizationService     = authorizationService;
     DiscordClient            = discordClient;
     DesignatedChannelService = designatedChannelService;
     UserService       = userService;
     PromotionsService = promotionsService;
     SelfUserProvider  = selfUserProvider;
 }
 /// <summary>
 /// Constructs a new <see cref="PromotionLoggingHandler"/> object, with injected dependencies.
 /// </summary>
 public PromotionLoggingHandler(
     IAuthorizationService authorizationService,
     IDiscordClient discordClient,
     IDesignatedChannelService designatedChannelService,
     IUserService userService,
     IPromotionsService promotionsService,
     ISelfUserProvider selfUserProvider,
     IOptions <ModixConfig> modixConfig)
 {
     AuthorizationService     = authorizationService;
     DiscordClient            = discordClient;
     DesignatedChannelService = designatedChannelService;
     UserService       = userService;
     PromotionsService = promotionsService;
     SelfUserProvider  = selfUserProvider;
     ModixConfig       = modixConfig.Value;
 }
 public CommandErrorHandler(ISelfUserProvider selfUserProvider, IMemoryCache memoryCache)
 {
     _selfUserProvider = selfUserProvider;
     _memoryCache      = memoryCache;
 }