Download the PHP package toropyga/telegram without Composer

On this page you can find all versions of the php package toropyga/telegram. 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 telegram

Telegram

Sending messages on behalf of a Telegram bot

License Version PHP

Content

General description

PHP library for sending Telegram bot messages, media files, and webhook requests through the Telegram Bot API.

To work, you need PHP version 8.1 or higher and the json, curl, and dom extensions. The package also uses Base and NetContent.

The Telegram class remains the backward-compatible facade. Its responsibilities are split into TelegramMessageSender, TelegramWebhook, TelegramTextConverter, and TelegramPayloadBuilder.

Installation

Install the package with Composer:

Configuration

Default values can be supplied to the constructor or configured with constants declared before creating the class:

Work description

Including the class

or use composer


Initialising the class

or with automatic connection of the NetContent class

or use constants configured before creating the class


Setting the method of interaction with the Telegram API when sending messages

Supported methods

Supported values are HTML, Markdown, MarkdownV2, and an empty string for plain text.


Converting text markup

The class provides static helpers for converting between HTML, Telegram Markdown, and MarkdownV2:

For custom conversions, use convertText($text, $from, $to). Supported formats are html, markdown, markdownv2, and plain.


Setting the bot token


Configuring the webhook


Removing the webhook


Getting webhook information


Setting the recipient chat ID


Enabling debug logging

When enabled, debug messages are stored in the internal log. Do not log bot tokens in production.


Getting logs

Returns the event log and configured log file name.


Sending a text message

Sending a message with the configured default parameters:


Sending a file

Sending a document to a user:

Sending a photo with the configured default parameters:


All versions of telegram with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1.0
toropyga/base Version ^2.0.0
toropyga/netcontent Version ^5.0.0
ext-json Version *
ext-curl Version *
ext-dom Version *
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 toropyga/telegram contains the following files

Loading the files please wait ...