Skip to content

Commit 808b15b

Browse files
committed
helpers/guild: pass value instead of option in editEmoji
1 parent 4613d4e commit 808b15b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dimscord/helpers/guild.nim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,13 @@ template editEmoji*(g: Guild, e: Emoji, name = none string;
147147
reason = ""
148148
): Future[Emoji] =
149149
## Modifies a guild emoji.
150-
getClient.api.editGuildEmoji(g.id, e.id, name, roles, reason)
150+
assert e.id.isSome, "Cannot edit Emoji: the emoji might not be custom"
151+
getClient.api.editGuildEmoji(g.id, e.id.unsafeGet(), name, roles, reason)
151152

152153
template deleteEmoji*(g: Guild, e: Emoji, reason = ""): Future[void] =
153154
## Deletes a guild emoji.
154-
getClient.api.deleteGuildEmoji(g.id, e.id, reason)
155+
assert e.id.isSome, "Cannot delete Emoji: the emoji might not be custom"
156+
getClient.api.deleteGuildEmoji(g.id, e.id.unsafeGet(), reason)
155157

156158
template getRegions*(g: Guild): Future[seq[VoiceRegion]] =
157159
## Gets a guild's voice regions.

0 commit comments

Comments
 (0)