diff --git a/README.md b/README.md index b6d01125..068a4080 100644 --- a/README.md +++ b/README.md @@ -183,7 +183,7 @@ python3 -m wechatter | | `to_person_list` | 消息转发目标用户列表,即消息接收用户 | 可以填多个用户名称或为空列表 | | | `to_group_list` | 消息转发目标群列表,即消息接收群 | 可以填多个群名称或为空列表 | -### ⚙️ Offical Account Reminder 配置 +### ⚙️ Official Account Reminder 配置 | 配置项 | 子项 | 解释 | 备注 | | --- | --- | --- | --- | diff --git a/wechatter/webhook_handlers/github/create_handler.py b/wechatter/webhook_handlers/github/create_handler.py index 8595344a..a04bca93 100644 --- a/wechatter/webhook_handlers/github/create_handler.py +++ b/wechatter/webhook_handlers/github/create_handler.py @@ -11,7 +11,7 @@ def handle_create(data: dict): if payload.ref_type == "branch": logger.info(f"Branch {payload.ref} was created by {payload.sender.login}.") message = ( - "==== GitHub Create 事件 ====\n" + "== GitHub Create 事件 ==\n" "🆕 有新的分支创建!\n" f"📚 仓库:{payload.repository.full_name}\n" f"🆕 创建了 {payload.ref} 分支\n" @@ -22,7 +22,7 @@ def handle_create(data: dict): elif payload.ref_type == "tag": logger.info(f"Tag {payload.ref} was created by {payload.sender.login}.") message = ( - "==== GitHub Create 事件 ====\n" + "== GitHub Create 事件 ==\n" "🆕 有新的标签创建!\n" f"📚 仓库:{payload.repository.full_name}\n" f"🆕 创建了 {payload.ref} 标签\n" diff --git a/wechatter/webhook_handlers/github/delete_handler.py b/wechatter/webhook_handlers/github/delete_handler.py index 83ebc642..f0391c1d 100644 --- a/wechatter/webhook_handlers/github/delete_handler.py +++ b/wechatter/webhook_handlers/github/delete_handler.py @@ -11,7 +11,7 @@ def handle_delete(data: dict): if payload.ref_type == "branch": logger.info(f"Branch {payload.ref} was deleted by {payload.sender.login}") message = ( - "==== GitHub Delete 事件 ====\n" + "== GitHub Delete 事件 ==\n" f"🚮 有分支被删除了!\n" f"📚 仓库:{payload.repository.full_name}\n" f"🚮 删除了 {payload.ref} 分支\n" @@ -22,7 +22,7 @@ def handle_delete(data: dict): elif payload.ref_type == "tag": logger.info(f"Tag {payload.ref} was deleted by {payload.sender.login}") message = ( - "==== GitHub Delete 事件 ====\n" + "== GitHub Delete 事件 ==\n" f"🚮 有标签被删除了!\n" f"📚 仓库:{payload.repository.full_name}\n" f"🚮 删除了 {payload.ref} 标签\n" diff --git a/wechatter/webhook_handlers/github/fork_handler.py b/wechatter/webhook_handlers/github/fork_handler.py index 40e19de1..8df7cc12 100644 --- a/wechatter/webhook_handlers/github/fork_handler.py +++ b/wechatter/webhook_handlers/github/fork_handler.py @@ -12,7 +12,7 @@ def handle_fork(data: dict): f"A new fork by {payload.sender.login} to {payload.repository.full_name}" ) message = ( - "==== GitHub Fork 事件 ====\n" + "== GitHub Fork 事件 ==\n" f"🍴 {payload.repository.full_name} 有新的 Fork!🆙\n" ) sender.mass_send_msg_to_github_webhook_receivers(message) diff --git a/wechatter/webhook_handlers/github/issue_comment_handler.py b/wechatter/webhook_handlers/github/issue_comment_handler.py index 602d394b..c01e371d 100644 --- a/wechatter/webhook_handlers/github/issue_comment_handler.py +++ b/wechatter/webhook_handlers/github/issue_comment_handler.py @@ -17,7 +17,7 @@ def handle_issue_comment(data: dict): else: content = payload.comment.body message = ( - "==== GitHub Comment 事件 ====\n" + "== GitHub Comment 事件 ==\n" f"💬 有评论被 {payload.action.capitalize()} !\n" f"📚 仓库:{payload.repository.full_name}\n" f"📝 标题:{payload.issue.title}\n" diff --git a/wechatter/webhook_handlers/github/issue_handler.py b/wechatter/webhook_handlers/github/issue_handler.py index b4009b63..622929b1 100644 --- a/wechatter/webhook_handlers/github/issue_handler.py +++ b/wechatter/webhook_handlers/github/issue_handler.py @@ -12,7 +12,7 @@ def handle_issue(data: dict): f"Issue {payload.issue.number} was {payload.action} by {payload.issue.user.login}." ) message = ( - "==== GitHub Issue 事件 ====\n" + "== GitHub Issue 事件 ==\n" f"📬 有问题被 {payload.action.capitalize()} !\n" f"📚 仓库:{payload.repository.full_name}\n" f"📝 标题:{payload.issue.title}\n" diff --git a/wechatter/webhook_handlers/github/ping_handler.py b/wechatter/webhook_handlers/github/ping_handler.py index 3100ea12..e0616cb2 100644 --- a/wechatter/webhook_handlers/github/ping_handler.py +++ b/wechatter/webhook_handlers/github/ping_handler.py @@ -10,7 +10,7 @@ def handle_ping(data: dict): payload = GithubPingWebhook(**data) logger.info(f"Ping from {payload.repository.full_name}.") message = ( - "==== GitHub Ping 事件 ====\n" + "== GitHub Ping 事件 ==\n" "❇️ 有 Ping 事件!\n" f"📝 ZEN:{payload.zen}\n" f"📚 仓库:{payload.repository.full_name}\n" diff --git a/wechatter/webhook_handlers/github/pr_handler.py b/wechatter/webhook_handlers/github/pr_handler.py index deb971c8..2dafd5bb 100644 --- a/wechatter/webhook_handlers/github/pr_handler.py +++ b/wechatter/webhook_handlers/github/pr_handler.py @@ -14,7 +14,7 @@ def handle_pr(data: dict): # 如果是closed,判断是否是合并 if payload.action == "closed" and payload.pull_request.merged: message = ( - "==== GitHub Pull Request 事件 ====\n" + "== GitHub Pull Request 事件 ==\n" f"⬇️ 有 PR 被 Merged !🥳\n" f"📚 仓库:{payload.repository.full_name}\n" f"📝 标题:{payload.pull_request.title}\n" @@ -25,7 +25,7 @@ def handle_pr(data: dict): sender.mass_send_msg_to_github_webhook_receivers(message) return message = ( - "==== GitHub Pull Request 事件 ====\n" + "== GitHub Pull Request 事件 ==\n" f"⬇️ 有 PR 被 {payload.action.capitalize()} !\n" f"📚 仓库:{payload.repository.full_name}\n" f"🌱 分支: {payload.pull_request.head.ref}\n" diff --git a/wechatter/webhook_handlers/github/pr_review_handler.py b/wechatter/webhook_handlers/github/pr_review_handler.py index b7998da5..40931318 100644 --- a/wechatter/webhook_handlers/github/pr_review_handler.py +++ b/wechatter/webhook_handlers/github/pr_review_handler.py @@ -12,7 +12,7 @@ def handle_pr_review(data: dict): f"Pull Request Review {payload.review.state} by {payload.review.user.login}." ) message = ( - "==== GitHub Pull Request Review 事件 ====\n" + "== GitHub Pull Request Review 事件 ==\n" f"⬇️ 有 PR Review 被 {payload.review.state.capitalize()} !\n" f"📚 仓库:{payload.repository.full_name}\n" f"📝 标题:{payload.pull_request.title}\n" diff --git a/wechatter/webhook_handlers/github/push_handler.py b/wechatter/webhook_handlers/github/push_handler.py index 188d4055..7870e655 100644 --- a/wechatter/webhook_handlers/github/push_handler.py +++ b/wechatter/webhook_handlers/github/push_handler.py @@ -15,7 +15,7 @@ def handle_push(data: dict): # 用 h5 的 a 标签,用于在微信中打开(经测试微信会吞掉 href 里的链接),下面方法失效 # branch_url = '查看详情' message = ( - "==== GitHub Push 事件 ====\n" + "== GitHub Push 事件 ==\n" "🚀 新的代码已经推送到了仓库!\n" f"📚 仓库:{payload.repository.full_name}\n" f"🌱 分支:{payload.ref}\n" diff --git a/wechatter/webhook_handlers/github/star_handler.py b/wechatter/webhook_handlers/github/star_handler.py index 8601c554..ff2f2d12 100644 --- a/wechatter/webhook_handlers/github/star_handler.py +++ b/wechatter/webhook_handlers/github/star_handler.py @@ -11,13 +11,13 @@ def handle_star(data: dict): logger.info(f"Star {payload.action} by {payload.sender.login}.") if payload.action == "created": message = ( - "==== GitHub Star 事件 ====\n" + "== GitHub Star 事件 ==\n" f"⭐️ {payload.repository.full_name} 的 Star 数量 +1 🆙!\n" ) sender.mass_send_msg_to_github_webhook_receivers(message) else: message = ( - "==== GitHub Star 事件 ====\n" + "== GitHub Star 事件 ==\n" f"⭐️ {payload.repository.full_name} 的 Star 数量 -1 🔽!\n" ) sender.mass_send_msg_to_github_webhook_receivers(message)