fix: resolve Telegram ticket notification issue

This commit is contained in:
xboard
2025-08-08 02:53:44 +08:00
parent 9f9db03cc3
commit f82a19f591
2 changed files with 3 additions and 3 deletions

View File

@@ -87,7 +87,7 @@ class TicketController extends Controller
) {
return $this->fail([400, __('Ticket reply failed')]);
}
HookManager::call('ticket.reply.user.after', [$ticket, $this->getLastMessage($ticket->id)]);
HookManager::call('ticket.reply.user.after', $ticket);
return $this->success(true);
}

View File

@@ -65,13 +65,13 @@ class Plugin extends AbstractPlugin
$this->telegramService->sendMessageWithAdmin($message, true);
}
public function sendTicketNotify(array $data): void
public function sendTicketNotify(Ticket $ticket): void
{
if (!$this->getConfig('enable_ticket_notify', true)) {
return;
}
[$ticket, $message] = $data;
$message = $ticket->messages()->latest()->first();
$user = User::find($ticket->user_id);
if (!$user)
return;