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 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(); }