mirror of
https://github.com/v2board/v2board.git
synced 2025-01-11 00:29:09 +08:00
update: reply ticket for telegram
This commit is contained in:
parent
e363666b89
commit
78a87125c8
@ -8,7 +8,7 @@ use App\Services\TicketService;
|
|||||||
|
|
||||||
class ReplyTicket extends Telegram {
|
class ReplyTicket extends Telegram {
|
||||||
public $regex = '/[#](.*)/';
|
public $regex = '/[#](.*)/';
|
||||||
public $description = '获取帮助';
|
public $description = '快速工单回复';
|
||||||
|
|
||||||
public function handle($message, $match = []) {
|
public function handle($message, $match = []) {
|
||||||
if (!$message->is_private) return;
|
if (!$message->is_private) return;
|
||||||
@ -24,13 +24,12 @@ class ReplyTicket extends Telegram {
|
|||||||
}
|
}
|
||||||
$ticketService = new TicketService();
|
$ticketService = new TicketService();
|
||||||
if (!$msg->text) return;
|
if (!$msg->text) return;
|
||||||
if ($user->is_admin || $user->is_staff) {
|
if (!($user->is_admin || $user->is_staff)) return;
|
||||||
$ticketService->replyByAdmin(
|
$ticketService->replyByAdmin(
|
||||||
$ticketId,
|
$ticketId,
|
||||||
$msg->text,
|
$msg->text,
|
||||||
$user->id
|
$user->id
|
||||||
);
|
);
|
||||||
}
|
|
||||||
$telegramService = $this->telegramService;
|
$telegramService = $this->telegramService;
|
||||||
$telegramService->sendMessage($msg->chat_id, "#`{$ticketId}` 的工单已回复成功", 'markdown');
|
$telegramService->sendMessage($msg->chat_id, "#`{$ticketId}` 的工单已回复成功", 'markdown');
|
||||||
$telegramService->sendMessageWithAdmin("#`{$ticketId}` 的工单已由 {$user->email} 进行回复", true);
|
$telegramService->sendMessageWithAdmin("#`{$ticketId}` 的工单已由 {$user->email} 进行回复", true);
|
||||||
|
Loading…
Reference in New Issue
Block a user