diff --git a/discord.go b/discord.go index 397e50de4704be614148e244793149108e1e3bdb..cfd42a34bee88389e537590cdf64f444eafaf2b5 100644 --- a/discord.go +++ b/discord.go @@ -142,14 +142,17 @@ func discordHandleCreate(session *discordgo.Session, create *discordgo.MessageCr } } - msg.Text = discordMakeHeader(create.Author) + msg.Text - for i, attachment := range create.Message.Attachments { msg.Text += fmt.Sprintf("\n[Attachment %v](%s)", i, attachment.URL) } 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 = discordMakeHeader(create.Author) + msg.Text if m, err := botAPI.Send(msg); err != nil { log.Printf("error relaying message %s, %s", create.Message.ID, err)