rafaelssucupira / telegram-api
该包最新版本(v1.0.0)没有提供许可信息。
Telegram/webhook API
v1.0.0
2024-08-30 18:07 UTC
Requires
- php: >=8.0.0
This package is auto-updated.
Last update: 2024-09-30 18:30:45 UTC
README
包含一些Telegram钩子功能的API
安装方法
composer require rafaelssucupira/telegram-api
示例
<?php
require_once("vendor/autoload.php");
use TelegramAPI\Telegram;
$telegram = new Telegram(
"TOKEM"
);
//Enviar mensagem
$msg = $telegram->sendMessage(
"xxxxxxxxx",
"Hello World!"
);
//Receber ID do arquivo
$getFileProfile = $telegram->getFileID(
"xxxxxxxxx"
);
//Receber path do arquivo
$path = $telegram->getPath(
json_decode($getFileProfile, true)["result"]["photos"][0][0]["file_id"]
);
//Baixar arquivo
$telegram->downloadFile(
"profile.jpg",
$path
);
?>