Telegram bots

Telegram bots

Platform for creating Telegram bots

This application is a platform for creating Telegram bots and by itself does not do anything. You will not see any settings or visible output.

The platform for Telegram bots can be used to easily write plug-ins, which, in turn, will be bots. In order for the bots to work, you must specify a hidden location for this application in the Site application. I recommend making a complex link to the settlement type telegram4e0214025588cde184591b300784b9d4 so that no one except you knows the exact reference to the bots.

The basis of this application is the project https://telegram-bot-sdk.readme.io/v2.0/docs. There you can find documentation for development in English.

To take advantage of all this functionality, you need to initialize the bot API class in the front controller, which is responsible for communicating the bot with Telegram. For example, like this:

$telegram = new telegramApi(BOT_TOKEN);

After that, all the methods described in the documentation above will become available.

The application is distributed free of charge and is available on the github: https://github.com/itfrogs/wa-telegram .
In this repository there is a free plugin steelrat, on the example of which you can study the interaction of the plug-in and the application.

This application and the plugin are distributed free of charge. The developer gives permission to use the code of the steelrat plug-in to create their own bots based on it. The texts in the plugin database can be used only for informational purposes to study the work with the plugin.

Before you start development, the bot must be registered and get its unique id, which is simultaneously a token. For this purpose in Telegram there is a special bot - @BotFather.

We write him /start and get a list of all his commands.
The first and main - /newbot - send it to him and the bot asks us to come up with a name for our new bot. The only restriction on the name - in the end it should end in "bot". If successful, BotFather returns a bot token and a link to quickly add the bot to the contacts, otherwise you'll have to break your head over the name.

Do not forget to check the received token using the link api.telegram.org/bot[BOT_TOKEN]/getMe, they say, it does not always work the first time.

The working example of the steelrat test bot: http://t.me/yousteelrat_bot .

Important: The site on which the bots will be launched must work over the HTTPS protocol and must be accessible from the global network.
The minimum version of PHP: 5.6