-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial port from Slackbot to Discord Connector
- Loading branch information
Showing
48 changed files
with
3,499 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea/ | ||
vendor/ | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
# seat-discord-bot | ||
# Seat Discord Connector | ||
A [SeAT](https://github.com/eveseat/seat) plugin which maintain user access on a Discord Guild based on defined pattern. | ||
|
||
[](https://packagist.org/packages/warlof/seat-discord-connector) | ||
[](https://packagist.org/packages/warlof/seat-discord-connector) | ||
[](https://travis-ci.org/warlof/seat-discord-connector) | ||
[](https://codeclimate.com/github/warlof/seat-discord-connector) | ||
[](https://coveralls.io/github/warlof/seat-discord-connector?branch=master) | ||
[](https://raw.githubusercontent.com/warlof/seat-discord-connector/master/LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "warlof/seat-discord-connector", | ||
"description": "A SeAT plugin which maintain user access on a Discord Guild based on defined pattern.", | ||
"type": "seat-plugin", | ||
"autoload": { | ||
"psr-4": { | ||
"Warlof\\Seat\\Connector\\Discord\\": "src/" | ||
} | ||
}, | ||
"require": { | ||
"eveseat/eveapi": "^3.0", | ||
"eveseat/web": "^3.0", | ||
"erusev/parsedown": "^1.7", | ||
"restcord/restcord": "^0.2" | ||
}, | ||
"license": "GPL-3.0-or-later", | ||
"authors": [ | ||
{ | ||
"name": "Warlof Tutsimo", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"minimum-stability": "stable", | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Warlof\\Seat\\Connector\\Discord\\DiscordConnectorServiceProvider" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** | ||
* This file is part of slackbot and provide user synchronization between both SeAT and a Slack Team | ||
* | ||
* Copyright (C) 2016, 2017, 2018 Loïc Leuilliot <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace Warlof\Seat\Connector\Discord\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Warlof\Seat\Connector\Discord\Models\DiscordLog; | ||
|
||
class DiscordLogsClear extends Command | ||
{ | ||
protected $signature = 'slack:logs:clear'; | ||
|
||
protected $description = 'Clearing slack logs'; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
} | ||
|
||
public function handle() | ||
{ | ||
DiscordLog::truncate(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/** | ||
* This file is part of slackbot and provide user synchronization between both SeAT and a Slack Team | ||
* | ||
* Copyright (C) 2016, 2017, 2018 Loïc Leuilliot <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace Warlof\Seat\Connector\Discord\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Warlof\Seat\Connector\Discord\Jobs\SyncRole; | ||
|
||
class DiscordRoleSync extends Command | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $signature = 'discord:role:sync'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $description = 'Fire a job which will attempt to pull roles static information from Discord Guild.'; | ||
|
||
/** | ||
* Execute the console command. | ||
*/ | ||
public function handle() | ||
{ | ||
|
||
SyncRole::dispatch(); | ||
|
||
$this->info('A synchronization job has been queued in order to update discord roles.'); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* This file is part of slackbot and provide user synchronization between both SeAT and a Slack Team | ||
* | ||
* Copyright (C) 2016, 2017, 2018 Loïc Leuilliot <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
namespace Warlof\Seat\Connector\Discord\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Warlof\Seat\Connector\Discord\Jobs\SyncUser; | ||
|
||
class DiscordUserSync extends Command | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $signature = 'discord:user:sync'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $description = 'Fire a job which will attempt to bind unlinked SeAT user to Discord user.'; | ||
|
||
/** | ||
* Execute the console command | ||
*/ | ||
public function handle() | ||
{ | ||
SyncUser::dispatch(); | ||
|
||
$this->info('A synchronization job has been queued in order to update discord/seat user relation.'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* This file is part of slackbot and provide user synchronization between both SeAT and a Slack Team | ||
* | ||
* Copyright (C) 2016, 2017, 2018 Loïc Leuilliot <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/* | ||
* TODO: lazy coder, remember to edit this file before TAG ! DAMMIT ! | ||
*/ | ||
return [ | ||
'version' => '3.0.0-beta1', | ||
'loggly' => [ | ||
'key' => 'b4aa3599-add7-4afc-aeb0-a9906b39f316', | ||
'tag' => 'discord-connector', | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* This file is part of slackbot and provide user synchronization between both SeAT and a Slack Team | ||
* | ||
* Copyright (C) 2016, 2017, 2018 Loïc Leuilliot <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
return [ | ||
'discord-connector' => [ | ||
'view', | ||
'create', | ||
'security', | ||
'setup', | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
/** | ||
* This file is part of slackbot and provide user synchronization between both SeAT and a Slack Team | ||
* | ||
* Copyright (C) 2016, 2017, 2018 Loïc Leuilliot <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
return [ | ||
'discord-connector' => [ | ||
'name' => 'Discord Connector', | ||
'icon' => 'fa-plug', | ||
'route_segment' => 'discord-connector', | ||
'entries' => [ | ||
[ | ||
'name' => 'Access Management', | ||
'label' => 'web::seat.access', | ||
'icon' => 'fa-shield', | ||
'route' => 'discord-connector.list', | ||
], | ||
[ | ||
'name' => 'User Mapping', | ||
'label' => 'discord-connector::seat.user_mapping', | ||
'icon' => 'fa-exchange', | ||
'route' => 'discord-connector.users' | ||
], | ||
[ | ||
'name' => 'Settings', | ||
'label' => 'web::seat.configuration', | ||
'icon' => 'fa-cogs', | ||
'route' => 'discord-connector.configuration', | ||
'permission' => 'discord-connector.setup' | ||
], | ||
[ | ||
'name' => 'Logs', | ||
'label' => 'web::seat.log', | ||
'plural' => true, | ||
'icon' => 'fa-list', | ||
'route' => 'discord-connector.logs' | ||
], | ||
], | ||
'permission' => 'discord-connector.view' | ||
], | ||
]; |
Oops, something went wrong.