diff --git a/main.go b/main.go index 16006d5..e9401bc 100644 --- a/main.go +++ b/main.go @@ -44,6 +44,13 @@ func tickGameStart(c *sn.Client) { for _, n := range mentions { + // we only care about current notifications + x := time.Now().Add(-30 * time.Second) + if n.Item.CreatedAt.Before(x) { + log.Println("ignoring old notification about item %d", n.Item.Id) + continue + } + if exists, err := db.ItemHasReply(n.Item.Id, meId); err != nil { log.Printf("failed to check for existing reply to game start in item %d: %v\n", n.Item.Id, err) continue