mvs/phbot

PHP Library for Telegram Bots


Keywords
bot, lib, php, php7, telegram
License
MIT

Documentation

Connect API Telegram


$app = new ApiConnectTelegram([
    'token' => '<SEU TOKEN>'
]);

Use get update Message


try {
    $request = $app->getUpdates();
} catch (\Exception $exception) {
    echo $exception->getMessage();
}

Use Send Message


$data = [
    'chat_id' => 0,
    'text'    => '<SUA MENSAGEM>'
];

try {
    $request = $app->sendMessage($data);
} catch (\Exception $exception) {
    echo $exception->getMessage();
}

License

A biblioteca Phbot é um software de código aberto licenciado sob a licença MIT license.