Download the PHP package lukasss93/telegrambot-php without Composer

On this page you can find all versions of the php package lukasss93/telegrambot-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package telegrambot-php

⚠️ This package is abandoned and no longer maintained.
Please use the nutgram/nutgram package instead.



TelegramBot-PHP

API PHP CURL

Latest Stable Version Total Downloads License

A very simple PHP Telegram Bot API for sending messages.

Requirements

For the WebHook:

For the GetUpdates:

Installation

You can install this library with composer:

composer require lukasss93/telegrambot-php

Configuration (WebHook)

Navigate to https://api.telegram.org/bot(TOKEN)/setWebhook?url=https://yoursite.com/your_update.php Or use the Telegram class setWebhook method.

Informations

This simple framework is object-based, all methods return a Telegram Object contained in TelegramBot/Types namespace.

Examples

If you want to get some specific parameter from the Telegram webhook, simply call parameter name in the object:

To upload a Photo or some other files, you need to load it with CurlFile:

To download a file on the Telegram's servers

If you want to use getUpdates instead of the WebHook you need a for cycle.

Message Object Methods

Message object mainly provide 2 methods:

Build keyboard parameters

Telegram's bots can have two different kind of keyboards: Inline and Reply. The InlineKeyboard is linked to a particular message, while the ReplyKeyboard is linked to the whole chat. They are both an array of array of buttons, which rapresent the rows and columns. For instance you can arrange a ReplyKeyboard using this code:

When a user click on the button, the button text is send back to the bot. For an InlineKeyboard it's pretty much the same (but you need to provide a valid URL or a Callback data)

This is the list of all the helper functions to make keyboards easily:

Send a custom keyboard. $option is an array of array KeyboardButton.
Check ReplyKeyBoardMarkUp for more info.

Send a custom keyboard. $inline_keyboard is an array of array InlineKeyboardButton.
Check InlineKeyboardMarkup for more info.

Create an InlineKeyboardButton.
Check InlineKeyBoardButton for more info.

Create a KeyboardButton.
Check KeyBoardButton for more info.

Hide a custom keyboard.
Check ReplyKeyBoarHide for more info.

Show a Reply interface to the user.
Check ForceReply for more info.

Contact me

You can contact me via Telegram but if you have an issue please open one.

To-Do list

Changelog

All notable changes to this project will be documented here.


All versions of telegrambot-php with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0
ext-mbstring Version *
ext-curl Version *
ext-fileinfo Version *
ext-json Version *
netresearch/jsonmapper Version ^v4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lukasss93/telegrambot-php contains the following files

Loading the files please wait ....