mirror of
https://github.com/appleboy/telegram-action.git
synced 2026-05-14 02:42:44 +00:00
docs: update readme
This commit is contained in:
@@ -13,6 +13,52 @@ action "Post message to Telegram" {
|
||||
"TELEGRAM_TOKEN",
|
||||
"TELEGRAM_TO",
|
||||
]
|
||||
args = "Hello World"
|
||||
args = "A new commit has been pushed."
|
||||
}
|
||||
```
|
||||
|
||||
## Secrets
|
||||
|
||||
Geting started with [Telegram Bot API](https://core.telegram.org/bots/api).
|
||||
|
||||
* `TELEGRAM_TOKEN`: Telegram authorization token.
|
||||
* `TELEGRAM_TO`: Unique identifier for this chat.
|
||||
|
||||
How to get unique identifier from telegram api:
|
||||
|
||||
```
|
||||
$ curl https://api.telegram.org/bot<token>/getUpdates
|
||||
```
|
||||
|
||||
See the result: (get chat id like `65382999`)
|
||||
|
||||
```json
|
||||
{
|
||||
"ok": true,
|
||||
"result": [
|
||||
{
|
||||
"update_id": 664568113,
|
||||
"message": {
|
||||
"message_id": 8423,
|
||||
"from": {
|
||||
"id": 65382999,
|
||||
"is_bot": false,
|
||||
"first_name": "Bo-Yi",
|
||||
"last_name": "Wu (appleboy)",
|
||||
"username": "appleboy46",
|
||||
"language_code": "en"
|
||||
},
|
||||
"chat": {
|
||||
"id": 65382999,
|
||||
"first_name": "Bo-Yi",
|
||||
"last_name": "Wu (appleboy)",
|
||||
"username": "appleboy46",
|
||||
"type": "private"
|
||||
},
|
||||
"date": 1550333434,
|
||||
"text": "?"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user