parent
2a9cb41ec6
commit
6bc0967a65
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue