Commit 20fc68ee authored by 王源's avatar 王源
Browse files

添加自动发送markdown 文本消息

parent 0dcffa46
Loading
Loading
Loading
Loading
+17 −0
Original line number Original line Diff line number Diff line
@@ -131,4 +131,21 @@ class MessageHandler
        $this->messageService->SendMarkDownMessage($receiverIds, $application, 0, $sendUserId, [], $content, $title);
        $this->messageService->SendMarkDownMessage($receiverIds, $application, 0, $sendUserId, [], $content, $title);
    }
    }


    /**
     * 自动发送markdown 文本消息
     * @param $receiverIds
     * @param $content
     * @param $title
     * @throws HttpResponseException
     */
    public function sendAutoMarkDownText($receiverIds, $content, $title)
    {
        $application = $this->config->get('app_name');
        if (!$application) {
            throw new HttpResponseException("请设置应用名app_name");
        }
        $receiverIds = is_array($receiverIds) ? $receiverIds : [$receiverIds];
        $this->messageService->SendMarkDownMessage($receiverIds, $application, 0, 0, [], $content, $title);
    }

}
}