public async Task NewGuild(ulong id, ulong cid) { BroadcastableGuild bg = new BroadcastableGuild(id, cid); await BroadcastableGuilds.AddAsync(bg); await SaveChangesAsync(); }
public async Task RemoveGuild(ulong id) { BroadcastableGuild bg = await BroadcastableGuilds.FirstOrDefaultAsync(x => x.GuildID == id); if (bg != null) { BroadcastableGuilds.Remove(bg); return; } throw new Exception("Guild not located in database."); }
public async Task ChangeChannel(ulong id, ulong newchannel) { BroadcastableGuild bg = await BroadcastableGuilds.FirstOrDefaultAsync(x => x.GuildID == id); if (bg != null) { bg.BroadcastChannelID = newchannel; await SaveChangesAsync(); return; } throw new Exception("Guild not located in database."); }