excelent/telegram-bot

此包最新版本(2.4)没有提供许可信息。

2.4 2023-01-20 14:41 UTC

This package is auto-updated.

Last update: 2024-09-12 13:07:05 UTC


README

库中的便利性

  • 快速
  • 可靠
    • 安全
  • 简单
    • 方便

注册

启动

启动前,需要将必要的模块下载到Bot.php文件中

<?php

use Telegram\Bot;
use Database\DB;

Webhook

现在需要设置webhook以使bot运行

  • webhook指向index.php,格式为 https://api.telegram.org/bot{bot-token}/setwebhook?url={文件路径}

接收发送给bot的消息

接收用户发送给bot的文本消息

Bot::getText();

发送消息

Bot.php

<?php

use Telegram\Bot;
use Database\DB;


Bot::sendMessage("Salom");