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(); }
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); }
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(); }
public async Task <bool> GetDisabledBuzzQueueAsync(ulong guildId) { GuildSetting guild = await this.Context.FindAsync <GuildSetting>(guildId); return(guild?.DisableBuzzQueue ?? false); }
public async Task <bool> GetUseBonusesAsync(ulong guildId) { GuildSetting guild = await this.Context.FindAsync <GuildSetting>(guildId); return(guild?.UseBonuses ?? false); }
public async Task <string> GetTeamRolePrefixAsync(ulong guildId) { GuildSetting guild = await this.Context.FindAsync <GuildSetting>(guildId); return(guild?.TeamRolePrefix ?? null); }