Ejemplo n.º 1
0
 public BanTracking(DiscordGuilds g, BanDataStructure savedDS)
 {
     _guilds       = g;
     statsdb       = new StatsDB();
     BanTreeAccess = new SemaphoreSlim(1, 1);
     bds           = savedDS;
     Console.WriteLine($"Loaded {bds.BanDict.Count} ban dict elements from the last backup");
 }
Ejemplo n.º 2
0
 public BanTracking(DiscordGuilds g)
 {
     Console.WriteLine("Creating bantracking without any previous data.");
     _guilds       = g;
     statsdb       = new StatsDB();
     BanTreeAccess = new SemaphoreSlim(1, 1);
     bds           = new BanDataStructure();
 }
Ejemplo n.º 3
0
        private Dictionary <ulong, RoleHighlighting> individualHLs; // An individual highlighter for each guild, indexed by the guild ID.

        /// <summary>
        /// A constructor that may only be called once the connection with the Discord API is made and we can pass the full list
        /// of all Discord guilds.
        /// </summary>
        /// <param name="allGuilds"></param>
        public MainHighlighter(DiscordGuilds allGuilds)
        {
            individualHLs = new Dictionary <ulong, RoleHighlighting>();
            _guilds       = allGuilds;

            foreach ((var guildID, var guild) in _guilds.byID)
            {
                RoleHighlighting singleHL = new RoleHighlighting(guild);
                individualHLs.Add(guildID, singleHL);
            }

            fullInit = true;
        }