Skip to content

Commit 384d89a

Browse files
committed
remove events since they are now fired in laravel core
1 parent 026ef1e commit 384d89a

File tree

3 files changed

+0
-69
lines changed

3 files changed

+0
-69
lines changed

src/Events/MessageWasSent.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/Events/SendingMessage.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/TelegramChannel.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
namespace NotificationChannels\Telegram;
44

55
use Illuminate\Notifications\Notification;
6-
use NotificationChannels\Telegram\Events\MessageWasSent;
7-
use NotificationChannels\Telegram\Events\SendingMessage;
86
use NotificationChannels\Telegram\Exceptions\CouldNotSendNotification;
97

108
class TelegramChannel
@@ -32,10 +30,6 @@ public function __construct(Telegram $telegram)
3230
*/
3331
public function send($notifiable, Notification $notification)
3432
{
35-
if (!$this->shouldSendMessage($notifiable, $notification)) {
36-
return;
37-
}
38-
3933
$message = $notification->toTelegram($notifiable);
4034

4135
if (is_string($message)) {
@@ -53,20 +47,5 @@ public function send($notifiable, Notification $notification)
5347
$params = $message->toArray();
5448

5549
$this->telegram->sendMessage($params);
56-
57-
event(new MessageWasSent($notifiable, $notification));
58-
}
59-
60-
/**
61-
* Check if we can send the notification.
62-
*
63-
* @param $notifiable
64-
* @param Notification $notification
65-
*
66-
* @return bool
67-
*/
68-
protected function shouldSendMessage($notifiable, Notification $notification)
69-
{
70-
return event(new SendingMessage($notifiable, $notification), [], true) !== false;
7150
}
7251
}

0 commit comments

Comments
 (0)