diff --git a/client.go b/client.go index 9a4bbb0..d769e8e 100644 --- a/client.go +++ b/client.go @@ -18,6 +18,12 @@ import ( "time" ) +var discordFmt = strings.NewReplacer( + "_", `\_`, + "*", `\*`, + "~", `\~`, +) + type Client struct { discord *discordgo.Session channelID string @@ -80,7 +86,7 @@ func (c *Client) sendChat(msg string) { func (c *Client) onChatMsg(msg chat.Message, _ byte, _ uuid.UUID) error { if c.discord != nil { - _, err := c.discord.ChannelMessageSend(c.channelID, msg.ClearString()) + _, err := c.discord.ChannelMessageSend(c.channelID, discordFmt.Replace(msg.ClearString())) return err } log.Info().Msg(msg.String())