Download the PHP package hugphp/telegram without Composer

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

Hugphp Telegram

GitHub Workflow Status (master) Total Downloads Latest Version License


HugPHP Telegram

A robust and type-safe Laravel package for interacting with the Telegram Bot API. This package provides a simple, performant, and flexible interface for sending messages, media, locations, contacts, and managing webhooks in your Laravel applications.

Features

Feature Roadmap

Feature Method Status
Send Message sendMessage ✅ Completed
Send Photo sendPhoto ✅ Completed
Send Video sendVideo ✅ Completed
Send Document sendDocument ✅ Completed
Send Location sendLocation ✅ Completed
Send Contact sendContact ✅ Completed
Set Webhook setWebhook ✅ Completed
Get Webhook Info getWebhookInfo ✅ Completed
Delete Webhook deleteWebhook ✅ Completed
Get Updates getUpdates ✅ Completed
Handle Callback Query handleCallbackQuery ☐ Pending
File Uploads fileUploads ☐ Pending
Send Notification sendNotification ☐ Pending

Installation

Install the package via Composer:

Publish the configuration file:

This creates a config/telegram.php file for configuring your Telegram bot settings.

Configuration

Edit config/telegram.php to set your bot token and other settings:

Add the following to your .env file:

Usage

The package provides a Telegram facade for easy interaction with the Telegram Bot API. Below are examples for each supported method, based on tested functionality.

Sending a Message

Send a formatted HTML message with an inline keyboard:

Example Response:

Sending a Photo

Send a photo with a caption:

Example Response:

Sending a Video

Send a video with a caption:

Example Response:

Sending a Document

Send a document with a caption:

Example Response:

Sending a Location

Send a live location:

Example Response:

Sending a Contact

Send a contact with first and last name:

Example Response:

Setting a Webhook

Set a webhook for receiving updates:

Example Response:

Getting Webhook Info

Retrieve webhook information:

Example Response:

Deleting a Webhook

Delete the current webhook:

Example Response:

Getting Updates

Retrieve bot updates:

Example Response:

Testing

The package includes a comprehensive test suite with 100% coverage using Pest. You can test all functionalities in your Laravel project by accessing the /validate-all-functionalities route:

This route tests all Telegram API methods and returns a JSON response with the status and results for each:

Run unit tests to verify the package:

Check test coverage:

Contributing

Contributions are welcome! Please submit a pull request or open an issue on GitHub.

License

This package is open-source software licensed under the MIT License.

Support

Hugphp Telegram was created by Micheal Ataklt.

For questions or support, open an issue on GitHub or contact the maintainer at [email protected].


All versions of telegram with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3.0
illuminate/support Version ^11.0|^12.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 hugphp/telegram contains the following files

Loading the files please wait ....