I
I
Islamfon2016-03-08 19:23:20
Command line
Islamfon, 2016-03-08 19:23:20

Telegram-cli how to process requests via php?

I am making a bot through telegram-cli.
Installed telegram-cli on the server, everything works fine.
In order for the bot to automatically respond, I do this: bin/telegram-cli -k tg-server.pub -W -s query.lua
Requests to the bot go to the query.lua.
Here's how to make it so that requests made to the bot are sent to a PHP file and processed by it?
I looked here https://github.com/zyberspace/php-telegram-cli-client, but nothing happened.
PS Willing to pay for the right hint

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Entelis, 2016-03-08
@DmitriyEntelis

Since Telegram launched the bot api, working with bots has become elementary and no wrappers are needed for it.
Through botfather you specify the url where messages are sent to the bot.
You collect a simple script there on php json_decode(file_get_contents('php://input'));and that's it.
Well, smoke https://core.telegram.org/bots if not yet.

A
Artem Lisovsky, 2018-03-30
@torrie

I recently solved it like this:
it would be more convenient, of course, to have an api
according to your implementation - the easiest way is to send a request from lua to php or as a post-request to any http

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question