Skip to content

Commit

Permalink
Ignore certain event types in Discord webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
carlbennett committed Dec 28, 2019
1 parent fe98ed8 commit 4bfdcb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions etc/config.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"discord": {
"forward_event_log": {
"enabled": false,
"ignore_event_types": [3,5,7,8,9,10,11],
"webhook": null
},
"invite_code": "u87WVeu",
Expand Down
4 changes: 3 additions & 1 deletion src/libraries/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ protected static function dispatchDiscordWebhook($event_id) {
$c = Common::$config->bnetdocs->discord->forward_event_log;
if (!$c->enabled) return;

$event = new Event($event_id);
$event = new Event($event_id);
if (in_array($event->getEventTypeId(), $c->ignore_event_types)) return;

$webhook = new DiscordWebhook($c->webhook);
$embed = new DiscordEmbed();

Expand Down

0 comments on commit 4bfdcb6

Please sign in to comment.