fix: dapper doesn't play nice with List<T>
This commit is contained in:
parent
64b4c26d93
commit
da4dfae27c
4 changed files with 31 additions and 6 deletions
|
|
@ -50,7 +50,7 @@ public class KeyRoleCommands(
|
|||
var guildRoles = roleCache.GuildRoles(guildId).ToList();
|
||||
var guildConfig = await db.GetGuildAsync(guildId);
|
||||
|
||||
if (guildConfig.KeyRoles.Count == 0)
|
||||
if (guildConfig.KeyRoles.Length == 0)
|
||||
return await feedbackService.ReplyAsync(
|
||||
"There are no key roles to list. Add some with `/key-roles add`.",
|
||||
isEphemeral: true
|
||||
|
|
@ -92,7 +92,7 @@ public class KeyRoleCommands(
|
|||
isEphemeral: true
|
||||
);
|
||||
|
||||
guildConfig.KeyRoles.Add(role.ID.Value);
|
||||
guildConfig.KeyRoles = guildConfig.KeyRoles.Append(role.ID.Value).ToArray();
|
||||
db.Update(guildConfig);
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ public class KeyRoleCommands(
|
|||
isEphemeral: true
|
||||
);
|
||||
|
||||
guildConfig.KeyRoles.Remove(role.ID.Value);
|
||||
guildConfig.KeyRoles = guildConfig.KeyRoles.Except([role.ID.Value]).ToArray();
|
||||
db.Update(guildConfig);
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue