From 6328b574a6aca407ee99e669a2c860cc7d96381c Mon Sep 17 00:00:00 2001 From: RandomChars <random@chars.jp> Date: Wed, 5 Jan 2022 07:15:05 +0900 Subject: [PATCH] escape "-" and "=" --- discord.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/discord.go b/discord.go index 1f4eff4..d606826 100644 --- a/discord.go +++ b/discord.go @@ -145,6 +145,8 @@ func discordHandleCreate(session *discordgo.Session, create *discordgo.MessageCr msg.ParseMode = "MarkdownV2" msg.Text = strings.ReplaceAll(msg.Text, ">", "\\>") msg.Text = strings.ReplaceAll(msg.Text, "_", "\\_") + msg.Text = strings.ReplaceAll(msg.Text, "-", "\\-") + msg.Text = strings.ReplaceAll(msg.Text, "=", "\\=") msg.Text = strings.ReplaceAll(msg.Text, "*", "\\*") msg.Text = strings.ReplaceAll(msg.Text, "[", "\\[") msg.Text = strings.ReplaceAll(msg.Text, "`", "\\`") -- GitLab