public async Task AddMarkovAsync(ulong id, string messageContent) { var server = await _context.Servers .FindAsync(id); if (server == null) { _context.Add(new Server { Id = id }); } _context.Add(new Markov { MessageContent = messageContent, ServerId = id }); await _context.SaveChangesAsync(); }
public async Task AddMutedAsync(ulong id, ulong userId) { var server = await _context.Servers .FindAsync(id); if (server == null) { _context.Add(new Server { Id = id }); } _context.Add(new Muted { UserId = userId, ServerId = id }); await _context.SaveChangesAsync(); }
public async Task AddAutoRoleAsync(ulong id, ulong roleId) { var server = await _context.Servers .FindAsync(id); if (server == null) { _context.Add(new Server { Id = id }); } _context.Add(new AutoRole { RoleId = roleId, ServerId = id }); await _context.SaveChangesAsync(); }
public async Task AddLimitAsync(ulong id, ulong channelId) { var server = await _context.Servers .FindAsync(id); if (server == null) { _context.Add(new Server { Id = id }); } _context.Add(new Limit { ChannelId = channelId, ServerId = id }); await _context.SaveChangesAsync(); }
public async Task ModifyGuildPrefix(ulong id, string prefix) { var server = await _context.Servers .FindAsync(id); if (server == null) { _context.Add(new Server { Id = id, Prefix = prefix }); } else { server.Prefix = prefix; } await _context.SaveChangesAsync(); }