1
0

Added option to customize the messages sent when the users starts streaming

This commit is contained in:
2020-05-18 23:15:59 +02:00
parent 5309271ebc
commit f6e409e7d5
11 changed files with 801 additions and 245 deletions

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTwitchWebhookEventsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('twitch_webhook_events', function (Blueprint $table) {
$table->id();
$table->foreignId("twitch_webhook_id")->references("id")->on("twitch_webhooks")->onUpdate("cascade")->onDelete("cascade");
$table->unsignedBigInteger("twitch_webhook_event_id");
$table->string("twitch_webhook_event_type");
$table->unique(["twitch_webhook_id", "twitch_webhook_event_type"]);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('twitch_webhook_events');
}
}

View File

@@ -0,0 +1,47 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateDiscordWebhookMessagesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('discord_webhook_messages', function (Blueprint $table) {
$table->id();
$table->boolean("enabled")->default(true);
$table->string("discord_webhook_url");
$table->string("username")->nullable();
$table->string("avatar")->nullable();
$table->text("content")->nullable();
$table->boolean("has_embed")->default(false);
$table->string("embed_color", 7)->default("#9147ff");
$table->boolean("embed_author_name")->default(false);
$table->boolean("embed_author_url")->default(false);
$table->boolean("embed_author_icon")->default(false);
$table->boolean("embed_thumbnail")->default(false);
$table->string("embed_title")->nullable();
$table->text("embed_description")->nullable();
$table->string("embed_url")->nullable();
$table->boolean("embed_image")->default(false);
$table->json("embed_fields")->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('discord_webhook_messages');
}
}