From 3be72d70fe5b951c9629238d3a724db8aaadfc0d Mon Sep 17 00:00:00 2001 From: Herpaderp Aldent Date: Mon, 31 Dec 2018 11:01:52 +0100 Subject: [PATCH 1/4] copy-pasta error --- src/resources/views/refresh_token/channel.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/views/refresh_token/channel.blade.php b/src/resources/views/refresh_token/channel.blade.php index fb38c96..5b329f2 100644 --- a/src/resources/views/refresh_token/channel.blade.php +++ b/src/resources/views/refresh_token/channel.blade.php @@ -15,7 +15,7 @@ @endif -@if( $RefreshTokenController->isDisabledButton('discord','channel') ) +@if( $RefreshTokenController->isDisabledButton('slack','channel') ) Slack From 19246f738bdc1e89b4a2b5bf96094c67981602eb Mon Sep 17 00:00:00 2001 From: Herpaderp Aldent Date: Mon, 31 Dec 2018 11:02:18 +0100 Subject: [PATCH 2/4] Fix exception if slack/discord is not setup --- .../Discord/DiscordNotificationChannelController.php | 4 ++-- .../Controllers/Slack/SlackNotificationChannelController.php | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Http/Controllers/Discord/DiscordNotificationChannelController.php b/src/Http/Controllers/Discord/DiscordNotificationChannelController.php index c08c0cf..710c035 100644 --- a/src/Http/Controllers/Discord/DiscordNotificationChannelController.php +++ b/src/Http/Controllers/Discord/DiscordNotificationChannelController.php @@ -24,8 +24,8 @@ public function getRegistrationView() : string public function getChannels() { - if(is_null(setting('herpaderp.seatnotifications.discord.credentials.guild_id', true))) - return redirect()->back()->with('error', 'No guild_id detected, have you setup your discord bot correctly?'); + if(is_null(setting('herpaderp.seatnotifications.discord.credentials.bot_token', true))) + return ['discord' => []]; $response = cache('herpaderp.seatnotifications.discord.channels'); diff --git a/src/Http/Controllers/Slack/SlackNotificationChannelController.php b/src/Http/Controllers/Slack/SlackNotificationChannelController.php index 7ad3334..7a91584 100644 --- a/src/Http/Controllers/Slack/SlackNotificationChannelController.php +++ b/src/Http/Controllers/Slack/SlackNotificationChannelController.php @@ -24,6 +24,9 @@ public function getRegistrationView() :string public function getChannels() { + if(is_null(setting('herpaderp.seatnotifications.slack.credentials.token', true))) + return ['slack' => []]; + $response = cache('herpaderp.seatnotifications.slack.channels'); if(is_null($response)){ From 08980fb829ef904011969aa5f28bcdee142a0bc0 Mon Sep 17 00:00:00 2001 From: Herpaderp Aldent Date: Mon, 31 Dec 2018 11:02:41 +0100 Subject: [PATCH 3/4] Add missing dependencies --- composer.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/composer.json b/composer.json index 65e54ff..1cbece2 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,9 @@ "laravel/framework": "5.5.*", "eveseat/web": "3.0.*", "erusev/parsedown": "^1.7", + "textalk/websocket": "1.0.*", "restcord/restcord": "^0.3", + "php-http/curl-client": "^1.7", "jolicode/slack-php-api": "^1.0" }, From 894d1fff620f30fc4e0116111d9361258ab29575 Mon Sep 17 00:00:00 2001 From: Herpaderp Aldent Date: Mon, 31 Dec 2018 12:02:26 +0100 Subject: [PATCH 4/4] Update readme --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b445777..71cd32d 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ please do report any findings to [seat-slack](https://eveseat-slack.herokuapp.co ### Enable Notification Channel To enable `seat-notifications` functionality of sending notifications. Create a bot for your notification channel. By default seat-notifications offers two notification channels which could be extended by other packages: `slack` and `discord`: -![configuration](https://i.imgur.com/pgfuSDO.png) +![configure](https://i.imgur.com/3ueTIaO.png) a more detailed guide on oAuth creation will follow for now the blow table must suffice: @@ -32,7 +32,10 @@ a more detailed guide on oAuth creation will follow for now the blow table must ***Note**: you may only configure one notification channel at your will. However, for discord you must create a bot in your application. For Slack you need to add the bot permission to your oauth scope.* ### Setup Roles -To be able to subsripe to a notification the user needs the appropriate permission. Please setup a role that carries the needed permission and assign it to users that should be able to receive the notification. +To be able to subscribe to a notification the user needs the appropriate permission. Please setup a role that carries the needed permission and assign it to users that should be able to receive the notification. + +### Restart workers +Since the notifications are send out by your workers you need to restart them to pick up the new code. Do this either via `docker-compose restart seat-worker` if you use docker, or `supervisorctl restart worker` on linux distributions. ### Authenticate Users need to authenticate for your setup notification channel prior to receiving notifications. they may do this in the registration box on the notification page.