Skip to content

Commit

Permalink
adding more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
NikkyAI committed Nov 2, 2023
1 parent f5eceea commit 75b2827
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/kotlin/moe/nikky/RoleManagementExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,9 @@ class RoleManagementExtension : Extension(), Klogging {
}
try {
roleMapping.forEach { entry ->
val reactionEmoji = entry.reactionEmoji(guild)
val reactionEmoji: ReactionEmoji = entry.reactionEmoji(guild)
val role = entry.getRole(guild)
logger.traceF { "adding reaction $reactionEmoji for role ${role.name}" }
message.addReaction(reactionEmoji)
val reactors = message.getReactors(reactionEmoji)
reactors.map { it.asMemberOrNull(guild.id) }
Expand Down Expand Up @@ -557,6 +558,11 @@ class RoleManagementExtension : Extension(), Klogging {
channel as? TextChannel ?: relayError("${channel.mention} is not a Text Channel")
}

val reaction = arguments.reaction
if(reaction is ReactionEmoji.Custom && reaction.isAnimated) {
relayError("animated emojis are not supported")
}

val configUnit = guild.config()
val (key, roleChooserConfig) = configUnit.get()?.find(arguments.section, channel.id)
?: run {
Expand Down

0 comments on commit 75b2827

Please sign in to comment.