Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #6 from herpaderpaldent/dev
Browse files Browse the repository at this point in the history
Version 1.0.1
  • Loading branch information
herpaderpaldent authored Dec 31, 2018
2 parents 8a242b1 + f6bf8a6 commit 6eec8f5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)){
Expand Down
2 changes: 1 addition & 1 deletion src/resources/views/refresh_token/channel.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</a>
@endif

@if( $RefreshTokenController->isDisabledButton('discord','channel') )
@if( $RefreshTokenController->isDisabledButton('slack','channel') )
<a href="" type="button" class="btn btn-app disabled">
<i class="fa fa-slack"></i>Slack
</a>
Expand Down

0 comments on commit 6eec8f5

Please sign in to comment.