refactor: change ulong[] to List<ulong> for better ergonomics
This commit is contained in:
parent
e12bd6194b
commit
4eb5c16451
8 changed files with 37 additions and 46 deletions
|
|
@ -49,7 +49,7 @@ public class KeyRoleCommands(
|
|||
var guildRoles = roleCache.GuildRoles(guildId).ToList();
|
||||
var guildConfig = await guildRepository.GetAsync(guildId);
|
||||
|
||||
if (guildConfig.KeyRoles.Length == 0)
|
||||
if (guildConfig.KeyRoles.Count == 0)
|
||||
return await feedbackService.ReplyAsync(
|
||||
"There are no key roles to list. Add some with `/key-roles add`.",
|
||||
isEphemeral: true
|
||||
|
|
@ -94,7 +94,8 @@ public class KeyRoleCommands(
|
|||
isEphemeral: true
|
||||
);
|
||||
|
||||
await guildRepository.AddKeyRoleAsync(guildId, role.ID);
|
||||
guildConfig.KeyRoles.Add(role.ID.Value);
|
||||
await guildRepository.UpdateConfigAsync(guildId, guildConfig);
|
||||
return await feedbackService.ReplyAsync($"Added {role.Name} to this server's key roles!");
|
||||
}
|
||||
|
||||
|
|
@ -119,7 +120,8 @@ public class KeyRoleCommands(
|
|||
isEphemeral: true
|
||||
);
|
||||
|
||||
await guildRepository.RemoveKeyRoleAsync(guildId, role.ID);
|
||||
guildConfig.KeyRoles.Remove(role.ID.Value);
|
||||
await guildRepository.UpdateConfigAsync(guildId, guildConfig);
|
||||
return await feedbackService.ReplyAsync(
|
||||
$"Removed {role.Name} from this server's key roles!"
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue