8 Commits

Author SHA1 Message Date
Abdullajonov Bobur 37056891d4 feat: Added support to sending message to group topic (#70) 2026-04-08 21:22:05 +08:00
Bo-Yi Wu 847a2d3240 chore(ci): update GitHub Actions dependencies to latest versions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 12:06:40 +08:00
appleboy 1b2bf60368 docs: localize README to Traditional Chinese
- Fix a typo in the README.zh-tw.md file
- Translate English text to Traditional Chinese in the README.zh-tw.md file

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-11-20 22:33:56 +08:00
appleboy 95f03551fd docs: translate documentation sections to Chinese
- Translate input variables section to Chinese
- Translate example section to Chinese
- Translate specific message sending instructions to Chinese
- Translate Telegram Bot API getting started instructions to Chinese
- Translate template variable section to Chinese

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-11-20 22:28:31 +08:00
appleboy 85afa0fd9a docs: enhance internationalization and testing framework
- Add links to Traditional Chinese and Simplified Chinese README files

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-11-20 22:27:23 +08:00
appleboy 84183da9cf docs: add Chinese READMEs for GitHub Actions notifications
- Add a Chinese (Simplified) README for GitHub Actions Telegram notifications
- Add a Chinese (Traditional) README for GitHub Actions Telegram notifications

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-11-20 22:27:02 +08:00
appleboy 5010c012e9 docs: improve documentation consistency and clarity
- Fix minor grammatical errors and improve clarity in the README.md
- Capitalize the first letter of list items in the options table for consistency

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-11-20 22:26:53 +08:00
appleboy 94584eda62 docs: improve documentation formatting and API usage
- Convert the list of optional parameters to a table format for better readability
- Fix the table formatting in the "See the result" section

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2024-11-20 22:08:01 +08:00
6 changed files with 311 additions and 26 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ jobs:
name: Build name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@v6
- name: send custom message with args - name: send custom message with args
uses: ./ uses: ./
with: with:
+3 -3
View File
@@ -13,17 +13,17 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v6
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup go - name: Setup go
uses: actions/setup-go@v5 uses: actions/setup-go@v6
with: with:
go-version: "^1" go-version: "^1"
- name: Run GoReleaser - name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6 uses: goreleaser/goreleaser-action@v7
with: with:
# either 'goreleaser' (default) or 'goreleaser-pro' # either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser distribution: goreleaser
+39 -22
View File
@@ -1,6 +1,8 @@
# 🚀 Telegram for GitHub Actions # 🚀 Telegram for GitHub Actions
[GitHub Action](https://github.com/features/actions) for sending a Telegram notification message. [繁體中文](./README.zh-tw.md) | [简体中文](./README.zh-cn.md)
[GitHub Action](https://github.com/features/actions) for sending Telegram notification messages.
![notification](./images/telegram-notification.png) ![notification](./images/telegram-notification.png)
@@ -8,9 +10,9 @@
## Usage ## Usage
**NOTE**: If you are getting "Error: Chat not found", then you need to look at this stackoverflow's answer [here](https://stackoverflow.com/a/41291666). **Note**: If you receive the "Error: Chat not found" error, please refer to this StackOverflow answer [here](https://stackoverflow.com/a/41291666).
Send custom message and see the custom variable as below. Send a custom message and view the custom variables below.
```yml ```yml
name: telegram message name: telegram message
@@ -49,25 +51,28 @@ Remove `args` to send the default message.
## Input variables ## Input variables
* socks5 - optional. support socks5 proxy URL | Variable | Description |
* photo - optional. photo message | ------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
* document - optional. document message | socks5 | optional. Support socks5 proxy URL |
* sticker - optional. sticker message | photo | optional. Photo message |
* audio - optional. audio message | document | optional. Document message |
* voice - optional. voice message | sticker | optional. Sticker message |
* location - optional. location message | audio | optional. Audio message |
* venue - optional. venue message | voice | optional. Voice message |
* video - optional. video message | location | optional. Location message |
* debug - optional. enable debug mode | venue | optional. Venue message |
* format - optional. `markdown` or `html`. See [MarkdownV2 style](https://core.telegram.org/bots/api#markdownv2-style) | video | optional. Video message |
* message - optional. custom message | debug | optional. Enable debug mode |
* message_file - optional. overwrite the default message template with the contents of the specified file. | format | optional. `markdown` or `html`. See [MarkdownV2 style](https://core.telegram.org/bots/api#markdownv2-style) |
* disable_web_page_preview - optional. disables link previews for links in this message. default is `false`. | message | optional. Custom message |
* disable_notification - optional. disables notifications for this message, supports sending a message without notification. default is `false`. | message_file | optional. Overwrite the default message template with the contents of the specified file. |
| message_thread_id | optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only. |
| disable_web_page_preview | optional. Disables link previews for links in this message. Default is `false`. |
| disable_notification | optional. Disables notifications for this message, supports sending a message without notification. Default is `false`. |
## Example ## Example
send photo message: Send photo message:
```yml ```yml
- uses: actions/checkout@master - uses: actions/checkout@master
@@ -81,7 +86,7 @@ send photo message:
document: tests/gophercolor.png document: tests/gophercolor.png
``` ```
send location message: Send location message:
```yml ```yml
- name: send location message - name: send location message
@@ -93,7 +98,19 @@ send location message:
venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市' venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
``` ```
send message using custom proxy (support `http`, `https`, and `socks5`) like `socks5://127.0.0.1:1080` or `http://222.124.154.19:23500` Send a message to a specific forum topic (thread):
```yml
- name: send message to forum topic
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message_thread_id: 42
message: Hello from GitHub Actions!
```
Send message using custom proxy (support `http`, `https`, and `socks5`) like `socks5://127.0.0.1:1080` or `http://222.124.154.19:23500`
```yml ```yml
- name: send message using socks5 proxy URL - name: send message using socks5 proxy URL
@@ -154,7 +171,7 @@ See the result: (get chat id like `65382999`)
## Template variable ## Template variable
| Github Variable | Telegram Template Variable | | Github Variable | Telegram Template Variable |
|-------------------|----------------------------| | ----------------- | -------------------------- |
| GITHUB_REPOSITORY | repo | | GITHUB_REPOSITORY | repo |
| GITHUB_ACTOR | repo.namespace | | GITHUB_ACTOR | repo.namespace |
| GITHUB_SHA | commit.sha | | GITHUB_SHA | commit.sha |
+133
View File
@@ -0,0 +1,133 @@
# 🚀 GitHub Actions 的 Telegram
[GitHub Action](https://github.com/features/actions) 用于发送 Telegram 通知消息。
![notification](./images/telegram-notification.png)
[![Actions Status](https://github.com/appleboy/telegram-action/workflows/telegram%20message/badge.svg)](https://github.com/appleboy/telegram-action/actions)
## 使用方法
**注意**:如果您收到 "Error: Chat not found" 错误,请参考这个 stackoverflow 的回答 [这里](https://stackoverflow.com/a/41291666)。
发送自定义消息并查看如下的自定义变量。
## 输入变量
| 变量 | 描述 |
| ------------------------ | ------------------------------------------------------------------------------------------------------- |
| socks5 | 可选。支持 socks5 代理 URL |
| photo | 可选。照片消息 |
| document | 可选。文档消息 |
| sticker | 可选。贴纸消息 |
| audio | 可选。音频消息 |
| voice | 可选。语音消息 |
| location | 可选。位置消息 |
| venue | 可选。场馆消息 |
| video | 可选。视频消息 |
| debug | 可选。启用调试模式 |
| format | 可选。`markdown``html`。参见 [MarkdownV2 样式](https://core.telegram.org/bots/api#markdownv2-style) |
| message | 可选。自定义消息 |
| message_file | 可选。用指定文件的内容覆盖默认消息模板。 |
| disable_web_page_preview | 可选。禁用此消息中链接的预览。默认值为 `false`。 |
| disable_notification | 可选。禁用此消息的通知,支持发送无通知的消息。默认值为 `false`。 |
## 示例
发送照片消息:
```yml
- uses: actions/checkout@master
- name: send photo message
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: send photo message
photo: tests/github.png
document: tests/gophercolor.png
```
发送位置消息:
```yml
- name: send location message
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
location: '24.9163213 121.1424972'
venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
```
使用自定义代理发送消息(支持 `http``https``socks5`),如 `socks5://127.0.0.1:1080``http://222.124.154.19:23500`
```yml
- name: send message using socks5 proxy URL
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
socks5: "http://222.124.154.19:23500"
message: Send message from socks5 proxy URL.
```
## Secrets
开始使用 [Telegram Bot API](https://core.telegram.org/bots/api)。
* `token`: Telegram 授权令牌。
* `to`: 此聊天的唯一标识符。
如何从 Telegram API 获取唯一标识符:
```bash
curl https://api.telegram.org/bot<token>/getUpdates
```
查看结果:(获取聊天 ID,如 `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": "?"
}
}
]
}
```
## 模板变量
| GitHub 变量 | Telegram 模板变量 |
| ----------------- | ----------------- |
| GITHUB_REPOSITORY | repo |
| GITHUB_ACTOR | repo.namespace |
| GITHUB_SHA | commit.sha |
| GITHUB_REF | commit.ref |
| GITHUB_WORKFLOW | github.workflow |
| GITHUB_ACTION | github.action |
| GITHUB_EVENT_NAME | github.event.name |
| GITHUB_EVENT_PATH | github.event.path |
| GITHUB_WORKSPACE | github.workspace |
+133
View File
@@ -0,0 +1,133 @@
# 🚀 Telegram 的 GitHub Actions
透過 [GitHub Action](https://github.com/features/actions) 發送 Telegram 通知訊息。
![通知](./images/telegram-notification.png)
[![Actions 狀態](https://github.com/appleboy/telegram-action/workflows/telegram%20message/badge.svg)](https://github.com/appleboy/telegram-action/actions)
## 使用方式
**注意**:如果您收到 "Error: Chat not found" 錯誤,請參考此 stackoverflow 上的回答 [連結](https://stackoverflow.com/a/41291666)。
發送自訂訊息並參考以下自訂變數。
## 輸入變數
| 變數 | 說明 |
| ------------------------ | ------------------------------------------------------------------------------------------------------- |
| socks5 | 選填。支援 socks5 代理 URL |
| photo | 選填。圖片訊息 |
| document | 選填。文件訊息 |
| sticker | 選填。貼圖訊息 |
| audio | 選填。音訊訊息 |
| voice | 選填。語音訊息 |
| location | 選填。位置訊息 |
| venue | 選填。地點訊息 |
| video | 選填。影片訊息 |
| debug | 選填。啟用除錯模式 |
| format | 選填。`markdown``html`。參見 [MarkdownV2 格式](https://core.telegram.org/bots/api#markdownv2-style) |
| message | 選填。自訂訊息 |
| message_file | 選填。使用指定檔案的內容覆蓋預設訊息模板 |
| disable_web_page_preview | 選填。停用此訊息中連結的預覽。預設為 `false` |
| disable_notification | 選填。停用此訊息的通知,支援發送無通知的訊息。預設為 `false` |
## 範例
發送圖片訊息:
```yml
- uses: actions/checkout@master
- name: send photo message
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: send photo message
photo: tests/github.png
document: tests/gophercolor.png
```
發送位置消息:
```yml
- name: send location message
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
location: '24.9163213 121.1424972'
venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'
```
使用自定義代理發送消息(支持 `http``https``socks5`),如 `socks5://127.0.0.1:1080``http://222.124.154.19:23500`
```yml
- name: send message using socks5 proxy URL
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
socks5: "http://222.124.154.19:23500"
message: Send message from socks5 proxy URL.
```
## Secrets
開始使用 [Telegram Bot API](https://core.telegram.org/bots/api)。
* `token`: Telegram 授權令牌。
* `to`: 此聊天的唯一標識符。
如何從 telegram api 獲取唯一標識符:
```bash
curl https://api.telegram.org/bot<token>/getUpdates
```
查看結果:(獲取聊天 ID,如 `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": "?"
}
}
]
}
```
## 模板變數
| Github 變數 | Telegram 模板變數 |
| ----------------- | ----------------- |
| GITHUB_REPOSITORY | repo |
| GITHUB_ACTOR | repo.namespace |
| GITHUB_SHA | commit.sha |
| GITHUB_REF | commit.ref |
| GITHUB_WORKFLOW | github.workflow |
| GITHUB_ACTION | github.action |
| GITHUB_EVENT_NAME | github.event.name |
| GITHUB_EVENT_PATH | github.event.path |
| GITHUB_WORKSPACE | github.workspace |
+2
View File
@@ -36,6 +36,8 @@ inputs:
description: 'disables link previews for links in this message' description: 'disables link previews for links in this message'
disable_notification: disable_notification:
description: 'disables notifications for this message, supports sending a message without notification,' description: 'disables notifications for this message, supports sending a message without notification,'
message_thread_id:
description: 'unique identifier for the target message thread (topic) of the forum; for forum supergroups only'
runs: runs:
using: 'docker' using: 'docker'
image: 'Dockerfile' image: 'Dockerfile'