smoqadam/telegramcli
Composer 安装命令:
composer require smoqadam/telegramcli
包简介
php wrapper for telegram cli
README 文档
README
PHP Telegram CLI
a wrapper class for working with tg-cli inspired by zyberspace/php-telegram-cli-client
install
create a composer.json and put the following command in it :
{
"require": {
"smoqadam/telegramcli": "@dev"
}
}
then run $ composer install
How to use
first start tg-cli :
$ ./bin/telegram-cli --json -dWS /tmp/t.sck &
then in your php file :
<?php require 'vendor/autoload.php'; $t = new Smoqadam\TelegramCli('unix:///tmp/t.sck'); $contacts = $t->contact_list(); //print_r($contacts); echo $t->post($contacts[0]['print_name'],'Hello');
The methods are exactly the same name as the original methods in tg-cli. For exapmple if you want to add new contact in tg-cli you must to use add_contact <phone> <name> <family> structure. In php-telegram-cli you must use the following command :
$t->add_contact('phone','name','family');
Contributing
This is a bery simple class for using tg-cli. If you need some useful features, you can fork it. Please let me know if you find bugs or any problems by openning new issue.
统计信息
- 总下载量: 2.17k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 17
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-03-31