feat: web, webhook and telegram channel drivers
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw
This commit is contained in:
20
core/app/Channels/ChannelDriver.php
Normal file
20
core/app/Channels/ChannelDriver.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Channels;
|
||||
|
||||
use App\Enums\Presence;
|
||||
use App\Models\Delivery;
|
||||
use App\Models\Event;
|
||||
use App\Models\User;
|
||||
|
||||
interface ChannelDriver
|
||||
{
|
||||
/** Пользователь сейчас доступен через этот канал? */
|
||||
public function presence(User $user, array $config): Presence;
|
||||
|
||||
/** Доставить напоминание. Не бросает: ошибки — в DeliveryOutcome::failed. */
|
||||
public function deliver(Event $event, User $user, array $config, Delivery $delivery): DeliveryOutcome;
|
||||
|
||||
/** Событие закрыто: убрать кнопки и т.п. Best effort, никогда не бросает. */
|
||||
public function onDone(Event $event, Delivery $delivery): void;
|
||||
}
|
||||
Reference in New Issue
Block a user