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
if wID != "" {
// skip events
if msg.Event != "" {
return "", nil
}
flog.Debugf("Broadcasting using Webhook")
err := b.c.WebhookExecute(
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
func (b *Bmattermost) sendWebhook(msg config.Message) (string, error) {
// skip events
if msg.Event != "" {
return "", nil
}
if b.Config.PrefixMessagesWithNick {
msg.Text = msg.Username + msg.Text
}