5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-26 12:21:35 +00:00

Skip events for webhook

This commit is contained in:
Wim 2018-02-24 22:38:27 +01:00
parent 63b88e77f2
commit d62f49d1fc
2 changed files with 9 additions and 0 deletions

View File

@ -128,6 +128,10 @@ func (b *bdiscord) Send(msg config.Message) (string, error) {
// Use webhook to send the message // Use webhook to send the message
if wID != "" { if wID != "" {
// skip events
if msg.Event != "" {
return "", nil
}
flog.Debugf("Broadcasting using Webhook") flog.Debugf("Broadcasting using Webhook")
err := b.c.WebhookExecute( err := b.c.WebhookExecute(
wID, wID,

View File

@ -361,6 +361,11 @@ func (b *Bmattermost) handleUploadFile(msg *config.Message) (string, error) {
// sendWebhook uses the configured WebhookURL to send the message // sendWebhook uses the configured WebhookURL to send the message
func (b *Bmattermost) sendWebhook(msg config.Message) (string, error) { func (b *Bmattermost) sendWebhook(msg config.Message) (string, error) {
// skip events
if msg.Event != "" {
return "", nil
}
if b.Config.PrefixMessagesWithNick { if b.Config.PrefixMessagesWithNick {
msg.Text = msg.Username + msg.Text msg.Text = msg.Username + msg.Text
} }