app using Ionic and have a PHP api backend for this app.
We need to integrate Telegram API messaging in this app, I need to use the API and not bot as we need to retrieve the users contacts to allow them to send new private message.
I have spent over 7 hours on looking for examples and Telegrams docs however still cant find a way to implement this, I wanted to know if anyone can point me in the right direction.
Telegram API This API allows you to build your own customized Telegram clients. It is 100% open for all developers who wish to create Telegram applications on our platform.
To send a message to the Telegram channel use the following PHP script example: <? php $apiToken = "5082654068:AAF7quCLZ4xuTq2FBdo3POssdJsM_FRHwTs"; $data = [ 'chat_id' => '515382482', 'text' => 'Hello from PHP! ' ]; $response = file_get_contents("https://api.telegram.org/bot$apiToken/sendMessage?" .
To create a chatbot on Telegram, you need to contact the BotFather, which is essentially a bot used to create other bots. The command you need is /newbot which leads to the following steps to create your bot: Your bot should have two attributes: a name and a username.
Suggestions: Ensure the Bot is in the group and as an admin. Try adding a new access token (revoke existing API key and create a new one then replace in plugin settings) If you edited the bot with @BotFather, make sure to restore it to the default settings.
PHP implementation of the telegram mtproto protocol.This project can run on PHP 7, PHP 5.6 and HHVM, only 64 bit systems are supported ATM.
https://github.com/danog/MadelineProto
or
https://daniil.it/MadelineProto
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With