Skip to content

Commit c7e8020

Browse files
authored
Merge pull request #83 from tanhongit/main
Update docs
2 parents 5e964a3 + 82a0eed commit c7e8020

File tree

2 files changed

+45
-18
lines changed

2 files changed

+45
-18
lines changed

README.md

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,45 @@ and manage customization through messages and buttons on Telegram.
1313
[![Quality Score](https://img.shields.io/scrutinizer/g/lbiltech/telegram-bot-github-notify.svg?style=flat-square)](https://scrutinizer-ci.com/g/lbiltech/telegram-bot-github-notify)
1414
[![Maintainability](https://api.codeclimate.com/v1/badges/460e2b6fba334a156b2e/maintainability)](https://codeclimate.com/github/lbiltech/telegram-bot-github-notify/maintainability)
1515

16-
## Information
16+
## 📝 Information
1717

1818
- Send GitHub notifications of your repositories to Telegram Bots, Groups, and Channels.
1919
- The bot must be created using the [BotFather](https://core.telegram.org/bots#6-botfather)
2020

21-
## Features
21+
## 🎉 Features
2222

2323
1. **GitHub Notifications to Telegram**: The package allows you to configure a Telegram bot to receive notifications from various GitHub events, including events like **commits, pull requests, issues, releases, and many more**.
2424

25+
<p align="center">
26+
<img alt="GitHub Notifications to Telegram" src="https://github.com/lbiltech/telegram-bot-github-notify/assets/35853002/462f330f-11d3-43ef-89cf-c70ade57b654" />
27+
</p>
28+
2529
2. **Customize Notifications**: You can customize the types of notifications you want to receive through options on Telegram.
2630

31+
[//]: # (features image)
32+
2733
3. **Interactive Buttons**: The package supports creating interactive buttons on Telegram to perform actions such as enabling or disabling notifications.
2834

35+
[//]: # (features image)
36+
2937
4. **Event Management**: You can manage specific events that you want to receive notifications for, allowing you to focus on what's most important for your projects.
3038

39+
<p align="center">
40+
<img alt="Event Management to Telegram" src="https://github.com/lbiltech/telegram-bot-github-notify/assets/35853002/e217a2ad-49b5-4936-a2cd-fe4af66e2bfb" />
41+
</p>
42+
3143
5. **Easy Integration**:
3244
The package provides an API and user-friendly functions to create a Telegram bot and link it to your GitHub account.
3345

34-
## Requirements
46+
[//]: # (features image)
47+
48+
## 📋 Requirements
3549

3650
- PHP ^8.0
3751
- Composer
3852
- Telegram Bot
3953

40-
## Installation
54+
## Installation
4155

4256
First, please clone and install this project via [Composer](https://getcomposer.org/):
4357

@@ -68,8 +82,8 @@ TELEGRAM_BOT_TOKEN=123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ
6882
### Get your Chat ID and add it to the .env file
6983

7084
1. Open a chat with your bot.
71-
2. Send a message to your bot.
72-
3. Go to the following URL: `https://api.telegram.org/bot<YourBOTToken>/getUpdates`
85+
2. Send any message to your bot. (This handle needs to get your chat id)
86+
3. Go to the following URL: `https://api.telegram.org/bot<YourTelegramBotToken>/getUpdates`
7387
4. Look for the `"chat":{"id":` field and copy the number after it. This is your Chat ID.
7488
5. Paste the Chat ID in your `.env` file.
7589

@@ -79,12 +93,13 @@ TELEGRAM_BOT_CHAT_ID=123456789
7993

8094
### Set up your domain and SSL certificate
8195

82-
**You need to set up your domain and SSL certificate to use the webhook**. You can build your own server or use a service like [Heroku](https://www.heroku.com/).
96+
**We recommend that you use HTTPS to set up your domain and webhook.**
97+
You can build your own server or use a service like [Heroku](https://www.heroku.com/).
8398

84-
In this example, we will use localhost and ngrok to set up the domain and webhook:
99+
In this example, we will use localhost and [ngrok](https://ngrok.com/) to set up the domain and webhook:
85100
1. Download and install [ngrok](https://ngrok.com/download).
86-
2. Run command in terminal: `php -S localhost:8000`
87-
3. Run command in terminal: `ngrok http 8000`
101+
2. Go to this project directory and run command in terminal: `php -S localhost:8000`
102+
3. Continue to run command in terminal: `ngrok http 8000`
88103
4. Copy the HTTPS URL provided by ngrok and paste it into your `.env` file.
89104

90105
```shell
@@ -97,7 +112,9 @@ We have two ways to set the webhook:
97112

98113
#### 1. Set the webhook from this project
99114

100-
After setting up your domain and SSL certificate, you need to set up the webhook for your bot. Go to:
115+
After setting up your domain and SSL certificate, you need to set up the webhook for your bot.
116+
117+
**Go to:**
101118

102119
```text
103120
<APP_URL>/webhook/set.php
@@ -111,15 +128,17 @@ If you see the following message, it means that the webhook has been sent succes
111128
{"ok":true,"result":true,"description":"Webhook was set"}
112129
```
113130

131+
[//]: # (status image)
132+
114133
#### 2. Set the webhook manually from Telegram
115134

116135
If you want to set the webhook manually, you can use the following URL:
117136

118137
```url
119-
https://api.telegram.org/bot<YourBOTToken>/setWebhook?url=<APP_URL>
138+
https://api.telegram.org/bot<YourTelegramBotToken>/setWebhook?url=<APP_URL>
120139
```
121140

122-
> **Note:** Replace `<YourBOTToken>` with your bot token and `<APP_URL>` with your app URL in .env file.
141+
> **Note:** Replace `<YourTelegramBotToken>` with your bot token and `<APP_URL>` with your app URL in .env file.
123142
124143
### Add chat ids you want to receive notifications to the .env file
125144

@@ -158,25 +177,31 @@ CONTAINER_NAME=telegram-notify-bot
158177
APP_PORT=3180
159178
```
160179

161-
## Usage
180+
## 🚀 Usage
162181

163182
Now you can send a message to your bot, and you will receive a welcome message from the bot.
164183

165184
```text
166185
/start
167186
```
168187

188+
[//]: # (image)
189+
169190
If you want to check the menu, you can send the following message to your bot.
170191

171192
```text
172193
/menu
173194
```
174195

175-
At this point, the configuration process for your telegram bot is completed. You can use all the features of this bot.
196+
🎊 **At this point, the configuration process for your telegram bot is completed. You can use all the features of this bot.** 🎉🎉
197+
198+
<p align="center">
199+
<img alt="Menu features of this bot" src="https://github.com/lbiltech/telegram-bot-github-notify/assets/35853002/5aa42173-9443-4978-a59a-82f2ed016790" />
200+
</p>
176201

177202
Now you will need to add the Webhook for your GitHub repository to receive notifications.
178203

179-
## Add webhook on your GitHub repository to receive notifications
204+
## 📌 Add webhook on your GitHub repository to receive notifications
180205

181206
1. Go to your repository settings
182207
2. Go to the `Webhooks` section
@@ -189,7 +214,9 @@ Now you will need to add the Webhook for your GitHub repository to receive notif
189214

190215
Here is the first notification you will receive:
191216

192-
![image](https://github.com/lbiltech/telegram-bot-github-notify/assets/35853002/66b7fffa-d2fa-41f6-8caa-3c1ab96b63be)
217+
<p align="center">
218+
<img alt="Github ping event notification" src="https://github.com/lbiltech/telegram-bot-github-notify/assets/35853002/66b7fffa-d2fa-41f6-8caa-3c1ab96b63be" />
219+
</p>
193220

194221
> **Note: You can set up this webhook for different repositories. Please similarly set up the webhook for each repository.**
195222

resources/tools/menu.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<b>BOT MENU</b>
1+
<b>BOT MENU</b> 🤖
22

33
/server - To get Server Information.
44
/id - To get your Chat ID.

0 commit comments

Comments
 (0)