Skip to content

Commit bb10b68

Browse files
committed
update readme
1 parent 3b443a8 commit bb10b68

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

README.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,32 @@ TELEGRAM_BOT_TOKEN=123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ
5454
TELEGRAM_BOT_CHAT_ID=123456789
5555
```
5656

57+
### Set up your domain and SSL certificate
58+
59+
**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/).
60+
61+
In this example, we will use localhost and ngrok to set up domain and webhook:
62+
1. Download and install [ngrok](https://ngrok.com/download).
63+
2. Run command in terminal: `php -S localhost:8000`
64+
3. Run command in terminal: `ngrok http 8000`
65+
4. Copy the HTTPS URL provided by ngrok and paste it into your `.env` file.
66+
67+
```shell
68+
APP_URL=https://123456789.ngrok.io
69+
```
70+
5771
### Set the webhook
5872

5973
#### Set the webhook from the source code
6074

6175
After setting up your domain and SSL certificate, you need to set up the webhook for your bot. Go to:
6276

63-
```http request
77+
```text
6478
<APP_URL>/setWebhook.php
6579
```
6680

81+
> **Note:** Replace `<APP_URL>` with your app URL in .env file.
82+
6783
If you see the following message, it means that the webhook has been sent successfully.
6884

6985
```json
@@ -74,14 +90,16 @@ If you see the following message, it means that the webhook has been sent succes
7490

7591
If you want to set the webhook manually, you can use the following URL:
7692

77-
```http request
93+
```text
7894
https://api.telegram.org/bot<YourBOTToken>/setWebhook?url=<APP_URL>
7995
```
8096

97+
> **Note:** Replace `<YourBOTToken>` with your bot token and `<APP_URL>` with your app URL in .env file.
98+
8199
### Add chat ids you want to receive notifications to the .env file
82100

83101
```shell
84-
TELEGRAM_NOTIFY_CHAT_IDS="123456789,987654321,-123456789"
102+
TELEGRAM_NOTIFY_CHAT_IDS="-978339113,-1001933979183"
85103
```
86104

87105
Now your configuration is complete. And it will be like this:
@@ -90,7 +108,7 @@ Now your configuration is complete. And it will be like this:
90108
APP_NAME='Telegram Github Notify Bot'
91109

92110
# Set your app URL here
93-
APP_URL=https://tele-noti-git.com
111+
APP_URL=https://123456789.ngrok.io
94112

95113
TELEGRAM_BOT_TOKEN=6162840106:AAH3g20lMQIkG_wHHu8R_ngdtG541uzoq4
96114
TELEGRAM_BOT_CHAT_ID=6872320129

0 commit comments

Comments
 (0)