public async Task <bool> AddGuild(DiscordGuild guild) { if (GuildSettings.Any(xr => xr.Id == guild.Id)) { return(false); } var Settings = await this.SettingsInstance.CreateGuildDefaultSettings(guild); GuildSettings.Add(Settings); await Settings.SaveGuild(this.SQLConn); return(true); }
public async Task <DiscordUrieGuild> FindGuildSettings(DiscordGuild SearchForGuild) { if (GuildSettings.Any(xr => xr.Id == SearchForGuild.Id)) { return(GuildSettings.First(xr => xr.Id == SearchForGuild.Id)); } else { DiscordUrieGuild NewDefaultServer = await this.SettingsInstance.CreateGuildDefaultSettings(SearchForGuild); GuildSettings.Add(NewDefaultServer); await NewDefaultServer.SaveGuild(this.SQLConn); return(NewDefaultServer); } }