Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions bridge/discord/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import (
"strings"
"time"

"github.com/bwmarrin/discordgo"
"github.com/davecgh/go-spew/spew"
Expand Down Expand Up @@ -75,6 +76,13 @@
}
// only when message is actually edited
if m.Message.EditedTimestamp != nil {
// message must have been edited within MaxEditDays
// (there is a discord glitch where old message edits get sent without user interaction)
delay := time.Since(*m.Message.EditedTimestamp)

Check failure on line 81 in bridge/discord/handlers.go

View workflow job for this annotation

GitHub Actions / golangci-lint

QF1008: could remove embedded field "Message" from selector (staticcheck)
if delay >= time.Duration(b.GetInt("MaxEditDays"))*24*time.Hour {
return
}

b.Log.Debugf("Sending edit message")
m.Content += b.GetString("EditSuffix")
msg := &discordgo.MessageCreate{
Expand Down
Loading