Skip to content

Commit

Permalink
Display "None" if the user has no roles
Browse files Browse the repository at this point in the history
  • Loading branch information
NoComment1105 committed Sep 23, 2024
1 parent 67e86a7 commit ac4ea58
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import org.hyacinthbots.lilybot.extensions.moderation.utils.ModerationAction
import org.hyacinthbots.lilybot.utils.baseModerationEmbed
import org.hyacinthbots.lilybot.utils.dmNotificationStatusEmbedField
import org.hyacinthbots.lilybot.utils.getLoggingChannelWithPerms
import org.hyacinthbots.lilybot.utils.ifNullOrEmpty
import org.hyacinthbots.lilybot.utils.interval

class ModerationEvents : Extension() {
Expand Down Expand Up @@ -298,12 +299,12 @@ class ModerationEvents : Extension() {
if (event.member.roleIds != event.old?.roleIds) {
field {
name = "New Roles"
value = newRoles.joinToString(", ")
value = newRoles.joinToString(", ").ifNullOrEmpty { "None" }
inline = true
}
field {
name = "Old roles"
value = oldRoles.joinToString(", ")
value = oldRoles.joinToString(", ").ifNullOrEmpty { "None" }
inline = true
}
}
Expand Down

0 comments on commit ac4ea58

Please sign in to comment.