コード例 #1
0
 public DiscordGuildDownloadQuartzHandler(ILogger <DiscordGuildDownloadQuartzHandler> logger, IConfiguration configuration, IScheduler scheduler, IDiscordGuildRoleService roleService)
 {
     _logger        = logger;
     _configuration = configuration;
     _scheduler     = scheduler;
     _roleService   = roleService;
 }
コード例 #2
0
        public void Setup()
        {
            _appFixture           = new ApplicationFixture();
            _roleService          = Substitute.For <IDiscordGuildRoleService>();
            _dateTime             = Substitute.For <IDateTime>();
            _roleConfiguration    = Substitute.For <IRoleConfiguration>();
            _directMessageService = Substitute.For <IDiscordDirectMessageService>();

            _dbContext      = Substitute.For <IApplicationDbContext>();
            _actionLogMock  = _dbContext.ConfigureMockDbSet(x => x.ModerationActionLogs);
            _activeMuteMock = _dbContext.ConfigureMockDbSet(x => x.ModerationActiveMutes);

            _currentUserService = Substitute.For <ICurrentUserService>();
            _currentUserId      = 14245;
            _currentUserService.UserId.Returns(_currentUserId.ToString());

            _roleId = 14245;
            _roleConfiguration.MuteRoleId.Returns(_roleId);

            _appFixture.OnConfigureServices += (_, services) =>
            {
                services.AddSingleton(_roleService);
                services.AddSingleton(_dbContext);
                services.AddSingleton(_dateTime);
                services.AddSingleton(_currentUserService);
                services.AddSingleton(_roleConfiguration);
                services.AddSingleton(_directMessageService);
            };
        }
コード例 #3
0
 public ApplyReactionRolesCommandHandler(IApplicationDbContext context,
                                         IDiscordGuildRoleService roleService,
                                         ILogger <ApplyReactionRolesCommandHandler> logger)
 {
     _context     = context;
     _roleService = roleService;
     _logger      = logger;
 }
コード例 #4
0
 public ApplyJoinRolesCommandHandler(IApplicationDbContext applicationDbContext,
                                     IDiscordGuildService discordGuildService, IDiscordGuildRoleService discordGuildRoleService,
                                     IDiscordGuildMemberService discordGuildMemberService, ILogger <ApplyJoinRolesCommandHandler> logger)
 {
     _applicationDbContext      = applicationDbContext;
     _discordGuildService       = discordGuildService;
     _discordGuildRoleService   = discordGuildRoleService;
     _discordGuildMemberService = discordGuildMemberService;
     _logger = logger;
 }
コード例 #5
0
 public void Setup()
 {
     _appFixture  = new ApplicationFixture();
     _dbContext   = Substitute.For <IApplicationDbContext>();
     _roleService = Substitute.For <IDiscordGuildRoleService>();
     _appFixture.OnConfigureServices += (_, services) =>
     {
         services.AddSingleton(_dbContext);
         services.AddSingleton(_roleService);
     };
 }
コード例 #6
0
 public UnMuteExpiredMutesCommandHandler(IApplicationDbContext dbContext,
                                         IDiscordGuildRoleService roleService,
                                         IDiscordConfiguration discordConfiguration,
                                         IRoleConfiguration roleConfiguration,
                                         IDateTime dateTime,
                                         ILogger <UnMuteExpiredMutesCommandHandler> logger)
 {
     _dbContext            = dbContext;
     _roleService          = roleService;
     _discordConfiguration = discordConfiguration;
     _roleConfiguration    = roleConfiguration;
     _dateTime             = dateTime;
     _logger = logger;
 }
コード例 #7
0
 public MuteCommandHandler(IDiscordGuildRoleService roleService,
                           IDateTime dateTime,
                           IApplicationDbContext dbContext,
                           IRoleConfiguration roleConfiguration,
                           IDiscordDirectMessageService directMessageService,
                           ICurrentUserService currentUserService)
 {
     _roleService          = roleService;
     _dateTime             = dateTime;
     _dbContext            = dbContext;
     _roleConfiguration    = roleConfiguration;
     _directMessageService = directMessageService;
     _currentUserService   = currentUserService;
 }
コード例 #8
0
        public void Setup()
        {
            _appFixture           = new ApplicationFixture();
            _dateTime             = Substitute.For <IDateTime>();
            _dbContext            = Substitute.For <IApplicationDbContext>();
            _roleService          = Substitute.For <IDiscordGuildRoleService>();
            _discordConfiguration = Substitute.For <IDiscordConfiguration>();

            _roleConfiguration = Substitute.For <IRoleConfiguration>();
            _roleConfiguration.MuteRoleId.Returns(_roleId);

            _appFixture.OnConfigureServices += (_, services) =>
            {
                services.AddSingleton(_dbContext);
                services.AddSingleton(_dateTime);
                services.AddSingleton(_roleService);
                services.AddSingleton(_discordConfiguration);
                services.AddSingleton(_roleConfiguration);
            };
        }
コード例 #9
0
 public ApplyConditionalRolesJob(IMediator mediator, IDiscordGuildRoleService roleService)
 {
     _mediator    = mediator;
     _roleService = roleService;
 }
コード例 #10
0
 public ApplyLevelRolesCommandHandler(IApplicationDbContext context, IDiscordGuildRoleService roleService)
 {
     _context     = context;
     _roleService = roleService;
 }