ya1c/telebot
最新稳定版本:1.0.0
Composer 安装命令:
composer require ya1c/telebot
包简介
Telebot - simple script for send messages to a bot
关键字:
README 文档
README
Telebot - simple class for send messages to a chat or to bot on PHP.
PHP Version Support
The currently required PHP version is PHP 8.0.
See the composer.json for other requirements.
Installation
Use composer to install Telebot into your project:
composer require ya1c/telebot
Example
require __DIR__.'/vendor/autoload.php'; use Ya\Telebot as Telebot; $connect = new Telebot(); $connect->setBotToken("");//e.g.: 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11 $connect->setChatId("");//Unique identifier for the target chat or username of the target channel e.g.: -10012345678 or 1234567 or @channelusername $sendOnlyText = $connect->sendMessage(["text"=>'Send only <b>text</b>']); $inline_button = ["text"=>"link", "url"=>"https://www.rct.uk/"]; $inline_keyboard = [[$inline_button]]; $keyboard=array("inline_keyboard"=>$inline_keyboard); $replyMarkup = json_encode($keyboard); $sendTextWhitReplyMarkup = $connect->sendMessage(["text"=>'Send <b>text</b> with reply markup'], 'message', $replyMarkup); $sendLocation = $connect->sendMessage(["latitude"=>51.5014, "longitude"=>0.1419], "location"); $sendContact = $connect->sendMessage(["phone_number"=>"+443031237300", "first_name"=>"Name", "last_name"=>"Lastname"], "contact"); $sendPhoto = $connect->sendMessage(["fileType"=>"photo", "photo"=>"https://www.rct.uk/sites/default/files/styles/rctr-scale-crop-1600-625/public/bp%20hero%20winter%201600%20x%20625.jpg?itok=bSBdwrwO", "caption"=>"This is photo"], "file");
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-02-02