Skip to content

Commit

Permalink
state: add filling out BeforeDelete before deleting message
Browse files Browse the repository at this point in the history
  • Loading branch information
sschiz committed Mar 1, 2020
1 parent 4027afe commit a026e5a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions state.go
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,13 @@ func (s *State) OnInterface(se *Session, i interface{}) (err error) {
}
case *MessageDelete:
if s.MaxMessageCount != 0 {
var old *Message
old, err = s.Message(t.ChannelID, t.ID)
if err == nil {
oldCopy := *old
t.BeforeDelete = &oldCopy
}

err = s.MessageRemove(t.Message)
}
case *MessageDeleteBulk:
Expand Down

0 comments on commit a026e5a

Please sign in to comment.