atlas89/telegram-notify-order

通知来自网站的新消息

v1.0.0 2021-04-09 08:30 UTC

This package is auto-updated.

Last update: 2024-09-12 14:47:25 UTC


README

一个简单的类,用于在Telegram中通知来自网站的新请求

创建机器人

通过BotFather创建机器人(获取token ID)

在Telegram中创建一个群组并添加我们的机器人

通过命令/group命令激活群组中的机器人

安装

    composer require atlas89/telegram-notify-order

使用

创建类的对象

    $client = new \atlasTelegramNotify\NotifyTelegram ("token", "chat_id");

其中,
token - 在通过Telegram的Botfather创建机器人时获得的机器人标识符
chat_id - 添加机器人聊天ID

或者不使用构造函数

    $client = new \atlasTelegramNotify\NotifyTelegram ();
    $client->setToken("token");
    $client->setChatID("chat_id");

向我们在Telegram中添加机器人的群组发送消息

    $response = $client->sendMessages("здесь указываем текст сообщения");

额外方法

获取机器人信息

    $response = $client->getMe();