Beispiel #1
0
        public async Task ClearTeamRolePrefixAsync(ulong guildId)
        {
            GuildSetting guild = await this.Context.FindAsync <GuildSetting>(guildId);

            if (guild == null)
            {
                return;
            }

            guild.TeamRolePrefix = null;
            await this.RemoveGuildIfEmptyAsync(guild);

            await this.Context.SaveChangesAsync();
        }
Beispiel #2
0
        public async Task <int> GetGuildExportCountAsync(ulong guildId)
        {
            GuildSetting guild = await this.AddOrGetGuildAsync(guildId);

            int currentDay = DateTime.UtcNow.Day;

            if (guild.LastExportDay != currentDay)
            {
                guild.LastExportDay = currentDay;
                guild.ExportCount   = 0;
                await this.Context.SaveChangesAsync();
            }

            return(guild.ExportCount);
        }
Beispiel #3
0
        public async Task IncrementGuildExportCountAsync(ulong guildId)
        {
            GuildSetting guild = await this.AddOrGetGuildAsync(guildId);

            int currentDay = DateTime.UtcNow.Day;

            if (guild.LastExportDay != currentDay)
            {
                guild.LastExportDay = currentDay;
                guild.ExportCount   = 1;
            }
            else
            {
                guild.ExportCount++;
            }

            await this.Context.SaveChangesAsync();
        }
Beispiel #4
0
        public async Task <bool> GetDisabledBuzzQueueAsync(ulong guildId)
        {
            GuildSetting guild = await this.Context.FindAsync <GuildSetting>(guildId);

            return(guild?.DisableBuzzQueue ?? false);
        }
Beispiel #5
0
        public async Task <bool> GetUseBonusesAsync(ulong guildId)
        {
            GuildSetting guild = await this.Context.FindAsync <GuildSetting>(guildId);

            return(guild?.UseBonuses ?? false);
        }
Beispiel #6
0
        public async Task <string> GetTeamRolePrefixAsync(ulong guildId)
        {
            GuildSetting guild = await this.Context.FindAsync <GuildSetting>(guildId);

            return(guild?.TeamRolePrefix ?? null);
        }