Esempio n. 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();
        }
Esempio n. 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);
        }
Esempio n. 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();
        }
Esempio n. 4
0
        public async Task <bool> GetDisabledBuzzQueueAsync(ulong guildId)
        {
            GuildSetting guild = await this.Context.FindAsync <GuildSetting>(guildId);

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

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

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