* Discord notifications for events #433 * Style fixes * Check for blank webhook urls and disable * Cleanup items after review * Changes and fixes * Style fixes * Don't load env for testing * Fix status text * Refactor saving fields/fares so events get the latest data * Cleanup * Style fixes
This commit is contained in:
32
app/Database/migrations/2021_06_01_141152_discord_fields.php
Normal file
32
app/Database/migrations/2021_06_01_141152_discord_fields.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DiscordFields extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
// Delete the old Discord fields and then a webhook will get added
|
||||
DB::table('settings')
|
||||
->where(['key' => 'notifications.discord_api_key'])
|
||||
->delete();
|
||||
|
||||
DB::table('settings')
|
||||
->where(['key' => 'notifications.discord_public_channel_id'])
|
||||
->delete();
|
||||
|
||||
DB::table('settings')
|
||||
->where(['key' => 'notifications.discord_public_channel_id'])
|
||||
->delete();
|
||||
|
||||
// Add a field to the user to enter their own Discord ID
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('discord_id')
|
||||
->default('')
|
||||
->after('rank_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -368,20 +368,20 @@
|
||||
options: ''
|
||||
type: boolean
|
||||
description: 'Count transfer hours in calculations, like ranks and the total hours'
|
||||
- key: notifications.discord_api_key
|
||||
name: Discord API token
|
||||
- key: notifications.discord_public_webhook_url
|
||||
name: Discord Public Webhook URL
|
||||
group: notifications
|
||||
value: ''
|
||||
options: ''
|
||||
type: text
|
||||
description: Discord API token for notifications
|
||||
- key: 'notifications.discord_public_channel_id'
|
||||
name: 'Discord Public Channel ID'
|
||||
group: 'notifications'
|
||||
description: The Discord Webhook URL for public notifications
|
||||
- key: notifications.discord_private_webhook_url
|
||||
name: Discord Private Webhook URL
|
||||
group: notifications
|
||||
value: ''
|
||||
options: ''
|
||||
type: 'text'
|
||||
description: 'Discord public channel ID for broadcasat notifications'
|
||||
type: text
|
||||
description: The Discord Webhook URL for private notifications
|
||||
- key: 'cron.random_id'
|
||||
name: 'Cron Randomized ID'
|
||||
group: 'cron'
|
||||
|
||||
Reference in New Issue
Block a user