From 7055227ace24b27fc67d7e47beb746d8e1852341 Mon Sep 17 00:00:00 2001 From: unintended fraud Date: Wed, 12 Oct 2022 08:25:41 +0200 Subject: [PATCH] t --- commands/pinned.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/commands/pinned.go b/commands/pinned.go index 0f50785..273366c 100644 --- a/commands/pinned.go +++ b/commands/pinned.go @@ -3,6 +3,7 @@ package commands import ( "encoding/json" "fmt" + "log" "math/rand" "strings" "time" @@ -77,33 +78,23 @@ var Pinned tempest.Command = tempest.Command{ } } - if err := itx.Client.CrosspostMessage(itx.ChannelId, channelData.MessageOfTheDay.Message.Id); err != nil { - fmt.Println("error crosspost", err) - itx.SendLinearReply(err.Error(), true) - } - - /* if err := itx.SendReply(tempest.ResponseData{ Content: formatMessageContent(channelData.MessageOfTheDay.Message), }, false); err != nil { - fmt.Println("error send reply", err) + log.Printf("failed to send reply with the pinned message: %s",err.Error()) itx.SendLinearReply(err.Error(), true) } - */ }, } func formatMessageContent(m tempest.Message) string { lines := []string{ - ">>> pin du jour", + ">>> **PIN DU JOUR**", fmt.Sprintf("par **%s** le %s", m.Author.Username, m.Timestamp.Format("02/01/2006 15:04")), - "-", m.Content, m.Author.AvatarHash, } - - return strings.Join(lines, "\n") }