PHPackages                             nguereza-tony/telegram-github-hook - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nguereza-tony/telegram-github-hook

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nguereza-tony/telegram-github-hook
==================================

This library is used to notify telegram chat on Github Webhook for push event

05PHPCI passing

Since Oct 5Pushed 7mo agoCompare

[ Source](https://github.com/nguereza-tony/telegram-github-hook)[ Packagist](https://packagist.org/packages/nguereza-tony/telegram-github-hook)[ RSS](/packages/nguereza-tony-telegram-github-hook/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Telegram Github Hook
--------------------

[](#telegram-github-hook)

**This library is used to notify telegram chat on Github Webhook for push event**

[![Project Status](https://camo.githubusercontent.com/5b5a2250da48f45495a817a4bcdabb5d101fff298acebe00a55a52815b7119ed/687474703a2f2f6f70656e736f757263652e626f782e636f6d2f6261646765732f6163746976652e737667)](http://opensource.box.com/badges)[![Latest Stable Version](https://camo.githubusercontent.com/8ab64553bdc695764bb8eab32e851634ff8da247eb10b20f486f5d1a520fef17/68747470733a2f2f706f7365722e707567782e6f72672f6e67756572657a612d746f6e792f74656c656772616d2d6769746875622d686f6f6b2f76)](https://packagist.org/packages/nguereza-tony/telegram-github-hook)[![Latest Unstable Version](https://camo.githubusercontent.com/1ef7fc5719f78465ec32fdaa5b0b2a68ccfb93f25ae0da706e0b0924f7d3087e/68747470733a2f2f706f7365722e707567782e6f72672f6e67756572657a612d746f6e792f74656c656772616d2d6769746875622d686f6f6b2f762f756e737461626c65)](https://packagist.org/packages/nguereza-tony/telegram-github-hook)[![Total Downloads](https://camo.githubusercontent.com/d8bfdff53c3b1370eb7a6c45ca889453f92f87983367185ad936c35eefcdede8/68747470733a2f2f706f7365722e707567782e6f72672f6e67756572657a612d746f6e792f74656c656772616d2d6769746875622d686f6f6b2f646f776e6c6f616473)](https://packagist.org/packages/nguereza-tony/telegram-github-hook)[![License](https://camo.githubusercontent.com/a2f10aa2d0abedb6fcf28c35d878b1fab3e7d80c48f0a58e6a68810758a3cfbe/68747470733a2f2f706f7365722e707567782e6f72672f6e67756572657a612d746f6e792f74656c656772616d2d6769746875622d686f6f6b2f6c6963656e7365)](https://packagist.org/packages/nguereza-tony/telegram-github-hook)
[![Tests](https://github.com/nguereza-tony/telegram-github-hook/actions/workflows/ci.yml/badge.svg)](https://github.com/nguereza-tony/telegram-github-hook/actions/workflows/ci.yml/badge.svg)[![Quality Score](https://camo.githubusercontent.com/db6e8f6686f7a2098637b39f7915c276ec309e09250cb0897c1ddda4fba9e00a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6e67756572657a612d746f6e792f74656c656772616d2d6769746875622d686f6f6b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/nguereza-tony/telegram-github-hook)[![Codacy Badge](https://camo.githubusercontent.com/c810474db53e6c784be98526b28d37fd36138f91e1c87d57fd6d6d4c9229df1d/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3762626331376338616666313433306338613532613834626137666632373837)](https://app.codacy.com/gh/nguereza-tony/telegram-github-hook/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Codacy Badge](https://camo.githubusercontent.com/6b8be4112777ab296c6ba54022a99a777d255d5e72777f48a553c050d610834a/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3762626331376338616666313433306338613532613834626137666632373837)](https://app.codacy.com/gh/nguereza-tony/telegram-github-hook/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)

### Requirements

[](#requirements)

- **PHP &gt;= 8.0**

### Installation

[](#installation)

#### Using composer (recommended)

[](#using-composer-recommended)

```
composer require nguereza-tony/telegram-github-hook
```

### Usage

[](#usage)

1. **Create telegram bot (if don't have already)**

- Create the Bot with BotFather: Open Telegram and search for "@BotFather". Ensure it is the official, verified account (look for the blue checkmark).
- Initiate a chat with BotFather and then send the command `/newbot` to BotFather.
- BotFather will prompt you to choose a display name for your bot. This can be a friendly name and does not need to be unique
- Next, you will need to select a unique username for your bot. This username must end with "bot" or "\_bot" (e.g., "MyAwesomeBot" or "My\_Awesome\_Bot").
- Upon successful creation, BotFather will provide you with an HTTP API token. This token is crucial for interacting with your bot programmatically and should be kept secure.

2. **Add bot to telegram group**

- Open your Telegram group.
- Tap the group's name at the top to open its info.
- Select "Administrators" from the options.
- Tap "Add administrator".
- Search for your bot's username in the search bar.
- Select the bot from the search results.
- Configure the bot's administrative rights as desired and tap "Finish" or "Save" to add it to the group.

3. **Add webhook in GitHub**

- Navigate to your repository and go to the main page of the GitHub repository where you want to add the webhook.
- Under your repository name, click on the Settings tab. If you don't see it, look for a dropdown menu and select Settings from there.
- In the left sidebar of the Settings page, click on Webhooks.
- Click the Add webhook button.
- Configure the webhook:
    - **Payload URL**: Enter the URL where you want GitHub to send the webhook payloads (the data about the events). This URL should point to your server or application that will process these payloads.
    - **Content type**: select the data format for the webhook payload. For our case it will be "application/json" to delivers the JSON payload directly in the request body.
    - **Secret (optional)**: keep empty for now.
    - **Events**: Choose which GitHub events should trigger the webhook. For now just select "Just the push event."
    - **Active**: Ensure the "Active" checkbox is selected to enable the webhook immediately after creation.
- Click the Add webhook button to save your configuration.

4. **Create the application**
    To deploy the application you need to create the configuration file in root or sub folder of your project like:

```
