Beispiel #1
0
 public BackupService(DbContextBuilder dbb, GuildConfigService gcs)
 {
     this.dbb     = dbb;
     this.gcs     = gcs;
     this.streams = new();
     this.LoadData();
 }
 protected ProtectionService(DbContextBuilder dbb, LoggingService ls, SchedulingService ss, GuildConfigService gcs, string reason)
 {
     this.dbb    = dbb;
     this.ss     = ss;
     this.ls     = ls;
     this.gcs    = gcs;
     this.reason = reason;
 }
 public AntifloodService(DbContextBuilder dbb, LoggingService ls, SchedulingService ss, GuildConfigService gcs)
     : base(dbb, ls, ss, gcs, "_gf: Flooding")
 {
     this.guildFloodUsers = new ConcurrentDictionary <ulong, ConcurrentHashSet <DiscordMember> >();
 }
 public AntiMentionService(DbContextBuilder dbb, LoggingService ls, SchedulingService ss, GuildConfigService gcs)
     : base(dbb, ls, ss, gcs, "_gf: Anti-mention")
 {
     this.guildExempts     = new ConcurrentDictionary <ulong, ConcurrentHashSet <ExemptedEntity> >();
     this.guildMentionInfo = new ConcurrentDictionary <ulong, ConcurrentDictionary <ulong, UserMentionInfo> >();
     this.refreshTimer     = new Timer(RefreshCallback, this, TimeSpan.FromMinutes(3), TimeSpan.FromMinutes(3));
 }
 public RatelimitService(DbContextBuilder dbb, LoggingService ls, SchedulingService ss, GuildConfigService gcs)
     : base(dbb, ls, ss, gcs, "_gf: Ratelimit hit")
 {
     this.guildExempts       = new ConcurrentDictionary <ulong, ConcurrentHashSet <ExemptedEntity> >();
     this.guildRatelimitInfo = new ConcurrentDictionary <ulong, ConcurrentDictionary <ulong, UserRatelimitInfo> >();
     this.refreshTimer       = new Timer(RefreshCallback, this, TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(20));
 }
 public LinkfilterService(DbContextBuilder dbb, LoggingService ls, SchedulingService ss, GuildConfigService gcs)
     : base(dbb, ls, ss, gcs, "_gf: Linkfilter")
 {
 }
Beispiel #7
0
 public AntiInstantLeaveService(DbContextBuilder dbb, LoggingService ls, SchedulingService ss, GuildConfigService gcs)
     : base(dbb, ls, ss, gcs, "_gf: Instant leave")
 {
     this.guildNewMembers = new ConcurrentDictionary <ulong, ConcurrentHashSet <DiscordMember> >();
 }
Beispiel #8
0
 public static bool IsChannelExempted(TheGodfatherBot shard, DiscordGuild?guild, DiscordChannel channel, out GuildConfigService gcs)
 {
     gcs = shard.Services.GetRequiredService <GuildConfigService>();
     return(guild is { } && gcs.IsChannelExempted(guild.Id, channel.Id, channel.ParentId));