2017 © Pedro Peláez
 

library telegramcli

php wrapper for telegram cli

image

smoqadam/telegramcli

php wrapper for telegram cli

  • Friday, April 1, 2016
  • by smoqadam
  • Repository
  • 3 Watchers
  • 14 Stars
  • 417 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 3 Open issues
  • 1 Versions
  • 4 % Grown

The README.md

PHP Telegram CLI

a wrapper class for working with tg-cli inspired by zyberspace/php-telegram-cli-client, (*1)

install

create a composer.json and put the following command in it :, (*2)

{
    "require": {
        "smoqadam/telegramcli": "@dev"
    }
}

then run $ composer install, (*3)

How to use

first start tg-cli :, (*4)

$ ./bin/telegram-cli --json -dWS /tmp/t.sck &, (*5)

then in your php file :, (*6)

<?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 :, (*7)

$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., (*8)

The Versions

01/04 2016

dev-master

9999999-dev

php wrapper for telegram cli

  Sources   Download

MIT

by Saeed Moqadam