mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-10-01 00:26:55 +02:00
32 lines
686 B
PHP
32 lines
686 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Observers\Discord;
|
|
|
|
use App\Actions\Discord\DiscordThreadAction;
|
|
use App\Models\Discord\DiscordThread;
|
|
|
|
class DiscordThreadObserver
|
|
{
|
|
/**
|
|
* Handle the DiscordThread "updated" event.
|
|
*/
|
|
public function updated(DiscordThread $thread): void
|
|
{
|
|
DiscordThreadAction::getHttp()
|
|
->put('/thread', $thread->toArray())
|
|
->throw();
|
|
}
|
|
|
|
/**
|
|
* Handle the DiscordThread "deleted" event.
|
|
*/
|
|
public function deleted(DiscordThread $thread): void
|
|
{
|
|
DiscordThreadAction::getHttp()
|
|
->delete('/thread', ['id' => $thread->getKey()])
|
|
->throw();
|
|
}
|
|
}
|