mohammad-rj/sdk-btelegram
Composer 安装命令:
composer require mohammad-rj/sdk-btelegram
包简介
Native PHP Telegram Bot based on the official Telegram Bot API
README 文档
README
In June 2017 when telegram itself haven't had even good docs about api bots on it site, right a day after i try php for the first time. there was a software development company that wanted to send a Photo on Telegram with local file, but they couldn't, so I wrote this SDK :d.
it's useful, easy and fast with Native PHP base of official Telegram Bot API,
Welcome to join in and feel free to contribute.
FULL AUTO | Installation requirement and environment
buy a VPS server linux centos9 and insert this code in terminal:
mkdir -p /var/www/html && cd $_
bash <(curl -s https://gist.githubusercontent.com/mohammad-rj/daad5f355cd1c90f96f6e0ff90378dd5/raw/install-base.sh)
composer require mohammad-rj/sdk-btelegram
cd vendor/mohammad-rj/sdk-btelegram/tests/
vi test.php #replace your bot_token
php test.php
MANUALLY | Installation
create virtual host on port 8443 or 443 with ssl self sertificate
composer require mohammad-rj/sdk-btelegram
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -sha256 -keyout $cert_path/bot1.key -out $cert_path/bot1.crt -subj '/C=US/ST=New York/L=NYC/O=Tbot/CN=$ip_address
curl -F 'url=https://$ip_address:8443$file_path' -F 'certificate=@$cert_path/$botname.crt' https://api.telegram.org/bot$bot_token/setWebhook
examples
SendMessage
require_once '../src/SDK-BTelegram.php'; $re = result(file_get_contents('php://input')); $SendMessage = new BT_SendMessage(); $SendMessage->botToken = $bot_token; $SendMessage->chat_id = $re->chat_id; $SendMessage->text = $re->text_result; $SendMessage->SendMessage();
I will add some complete examples soon ..
mohammad-rj/sdk-btelegram 适用场景与选型建议
mohammad-rj/sdk-btelegram 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 10 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 mohammad-rj/sdk-btelegram 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mohammad-rj/sdk-btelegram 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-13