Answer the question
In order to leave comments, you need to log in
How to write a script for issuing data from a table in a TG-bot?
Hello. Please help with solving one problem related to the online table and the Telegram bot.
Here is a table , you can look at it to understand the issue.
The bottom line is this: let's say I created a bot and linked it to a table (fortunately there are detailed instructions for this), but I can't figure out how to write a code / script so that when sending the "day 1" command to the bot, it collects certain information from the table, and in the form of a list returned it to me in the chat.
For example, in this case, the table has a list of users with the dates of their subscriptions, and there is a column where the remaining days of the subscription are indicated in numbers (1, 2, and so on days). I need that when querying "day 1", "day 2" or "day 3"
I write to the bot "day 2", it finds who has 2 days of subscription left and returns me:
8a Gregory
9a Nadya
14a Eva
Please tell me how to write such a script/script.
Answer the question
In order to leave comments, you need to log in
In short, this is how:
1) Create a bot, copy the token
2) Write a webhook handler (doPost()) - see what and who sent there, you can send data in response to this
3) Deploy the script from the editor, copy the URL of the script
4) Bind the webhook (setWebhook) to the telegram bot
If you need a ready-made solution, write in a personal
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question