mirror of
https://github.com/42wim/matterbridge.git
synced 2025-01-30 10:29:02 -08:00
Handle deletion of webhook messages
This commit is contained in:
parent
b321268499
commit
4ec929a4bd
@ -109,6 +109,21 @@ func (b *Bdiscord) webhookSend(msg *config.Message, channelID string) (*discordg
|
||||
}
|
||||
|
||||
func (b *Bdiscord) handleEventWebhook(msg *config.Message, channelID string) (string, error) {
|
||||
if msg.Event == config.EventMsgDelete {
|
||||
if msg.ID == "" {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
err := b.transmitter.Delete(channelID, msg.ID)
|
||||
if err != nil {
|
||||
b.Log.Errorf("Could not delete message: %s", err)
|
||||
return "", err
|
||||
}
|
||||
|
||||
b.Log.Infof("Message deleted successfully")
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// skip events
|
||||
if msg.Event != "" && msg.Event != config.EventUserAction && msg.Event != config.EventJoinLeave && msg.Event != config.EventTopicChange {
|
||||
return "", nil
|
||||
|
Loading…
Reference in New Issue
Block a user