Skip to content

Commit

Permalink
Fix markdown display for emotes
Browse files Browse the repository at this point in the history
  • Loading branch information
duncte123 committed Jun 29, 2021
1 parent ba79440 commit b51e340
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ import ml.duncte123.skybot.objects.command.Command
import ml.duncte123.skybot.objects.command.CommandCategory
import ml.duncte123.skybot.objects.command.CommandContext
import ml.duncte123.skybot.utils.TwemojiParser.stripVariants
import net.dv8tion.jda.api.EmbedBuilder
import net.dv8tion.jda.api.entities.Emote

class EmoteCommand : Command() {
init {
this.category = CommandCategory.UTILS
this.name = "emote"
this.aliases = arrayOf("emoji")
this.aliases = arrayOf("emoji", "unicode")
this.help = "Shows information about an emoji or emote"
this.usage = "<emote>"
}
Expand Down Expand Up @@ -66,13 +67,14 @@ class EmoteCommand : Command() {
val id = emote.id
val guild = if (emote.guild == null) "Unknown" else emote.guild!!.name
val url = emote.imageUrl
val markdownStr = "<${EmbedBuilder.ZERO_WIDTH_SPACE}:${emote.name}:${emote.idLong}>"

sendMsg(
ctx,
"""**Emote:** $name
|**Id:** $id
|**Guild:** $guild
|**Markdown:** `${emote.asMention}`
|**Markdown:** `$markdownStr` (there's a ZWSP after the first `<`)
|**Url:** $url
""".trimMargin()
)
Expand Down

0 comments on commit b51e340

Please sign in to comment.