Skip to content

docs(blog): add tutorial on building WeChat group bot with Wechaty PadLocal#199

Open
dihe709155244 wants to merge 1 commit intowechaty:mainfrom
dihe709155244:add-padlocal-group-bot-blog
Open

docs(blog): add tutorial on building WeChat group bot with Wechaty PadLocal#199
dihe709155244 wants to merge 1 commit intowechaty:mainfrom
dihe709155244:add-padlocal-group-bot-blog

Conversation

@dihe709155244
Copy link
Copy Markdown

@dihe709155244 dihe709155244 commented Apr 3, 2026

概述

本文是一篇从零开始的教程,指导读者使用 Wechaty 和 PadLocal 协议搭建微信群机器人。

主要内容

  • 申请 PadLocal Token
  • 初始化项目并编写基础机器人代码
  • 处理文字和图片消息
  • 常见问题解答

文件变更

  • 新增博客文章 _posts/2026-04-01-building-wechat-group-bot-with-wechaty-padlocal.md
  • 新增贡献者信息 _contributors/dihe709155244.md
  • 新增封面图和头像

Summary by CodeRabbit

  • Documentation

    • Added a bilingual tutorial on building WeChat group bots with Wechaty (PadLocal), including setup, code examples for handling text and images, FAQ, and a link to the example repository.
  • New Contributors

    • Added a contributor profile with name, bio, avatar, website, and contact details.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

Warning

Rate limit exceeded

@dihe709155244 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 28 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 7 minutes and 28 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fd3b3836-c0f6-46d4-9230-64bfd626b2f2

📥 Commits

Reviewing files that changed from the base of the PR and between c4d1795 and 12a91c4.

📒 Files selected for processing (4)
  • jekyll/_contributors/dihe709155244.md
  • jekyll/_posts/2026-04-01-building-wechat-group-bot-with-wechaty-padlocal.md
  • jekyll/assets/2026/04-building-wechat-group-bot-with-wechaty-padlocal/post-teaser-image.webp
  • jekyll/assets/contributors/dihe709155244/avatar.webp
📝 Walkthrough

Walkthrough

This PR adds two new Jekyll content files: a contributor profile for dihe709155244 with metadata/contact info, and a bilingual tutorial post on building a WeChat group bot using Wechaty with the PadLocal protocol.

Changes

Cohort / File(s) Summary
Jekyll Contributor
jekyll/_contributors/dihe709155244.md
New contributor markdown page with YAML front matter: name, site, bio, avatar, email; includes a contact section and no trailing newline.
Jekyll Post
jekyll/_posts/2026-04-01-building-wechat-group-bot-with-wechaty-padlocal.md
New bilingual (ZH/EN) tutorial post: front matter (title, author, tags, teaser), PadLocal token instructions, npm/Wechaty setup, WechatyBuilder bot example with scan/login/message handlers, group message logging, keyword auto-reply, image handling via message.toFileBox().toBuffer() for OCR, FAQ, and repo link.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • huan

Poem

🐰 I hopped in bytes and left a note,
A profile placed, a bot to quote.
Tokens found and messages spun,
Rabbity code, a job well done. 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a tutorial blog post about building a WeChat group bot using Wechaty with PadLocal protocol, which directly matches the primary content added in the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (1)
jekyll/_posts/2026-04-01-building-wechat-group-bot-with-wechaty-padlocal.md (1)

50-50: Polish Chinese phrasing for grammatical correctness.

提交博客或代码 PR 被合并 reads awkwardly; prefer 提交的博客或代码 PR 可被合并后 (or equivalent natural rewrite).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@jekyll/_posts/2026-04-01-building-wechat-group-bot-with-wechaty-padlocal.md`
at line 50, Rephrase the Chinese sentence "提交博客或代码 PR 被合并" to a grammatically
natural form; locate the line containing "💡 长期免费 Token:成为 Wechaty 贡献者(提交博客或代码
PR 被合并)后可向官方申请长期 Token。" and replace the parenthetical with a smoother phrasing
such as "(提交的博客或代码 PR 被合并后)" or another natural alternative that keeps the
meaning intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@jekyll/_contributors/dihe709155244.md`:
- Line 15: The GitHub link in the contact section of dihe709155244.md points to
the wrong username (zzzyer); update the URL to match the contributor username
used elsewhere (dihe709155244) so the link becomes
https://github.com/dihe709155244 and verify the contact line now matches the
front matter "name" and site fields.
- Line 16: Add a single trailing newline character at the end of the file so it
ends with exactly one newline; specifically ensure the last line containing
"Email:<709155244@qq.com>" is followed by a newline (no extra blank lines) to
satisfy Markdown/file EOF conventions.
- Line 9: Remove the stray YAML document separator '---' that appears after the
front matter end—there is a duplicate '---' token (the one after the
already-closed front matter) that should be deleted so the file contains only
the single opening/closing front-matter block; locate the extra '---' and remove
it to restore valid Jekyll front matter parsing.
- Around line 1-7: Remove the stray YAML document separator '---' that appears
after the front matter (the duplicate separator) so the front matter block is
valid; update the site field URL to use the contributor's actual GitHub username
by changing the site value to "https://github.com/dihe709155244" (matching the
name: dihe709155244), replace any non-ASCII Chinese colon with a standard ASCII
':' character in the metadata lines, and ensure the file ends with a single
trailing newline.

In `@jekyll/_posts/2026-04-01-building-wechat-group-bot-with-wechaty-padlocal.md`:
- Around line 155-156: The post currently claims "完整代码已托管在 GitHub(链接见文末),欢迎 Star
和 PR。" (and the equivalent English sentence around lines 284-285) but no
repository URL is provided; either append the actual GitHub repository URL to
the end of the post and update both the Chinese and English sentences to include
that link, or remove/modify the "link below" phrasing in both the Chinese and
English sections so they no longer promise a missing link (update the sentences
that contain the exact text "完整代码已托管在 GitHub(链接见文末),欢迎 Star 和 PR。" and its
English counterpart).
- Line 12: The front-matter "image" value uses an incorrect path; update the
image front-matter in
jekyll/_posts/2026-04-01-building-wechat-group-bot-with-wechaty-padlocal.md so
it follows the required asset convention:
/assets/YYYY/MM-post-slug/post-teaser-image.webp. Replace the current value
(image: /assets/2026/04-wechaty-padlocal-group-bot/cover.png) with the correct
slug-matched teaser path (e.g. image:
/assets/2026/04-building-wechat-group-bot-with-wechaty-padlocal/post-teaser-image.webp)
ensuring the folder name exactly matches the post slug and the file is named
post-teaser-image.webp.
- Around line 1-13: Add a missing front-matter field named excerpt to the post's
YAML block (the top --- section) so it complies with the jekyll/_posts
front-matter contract; insert an "excerpt: \"...\"" line under
title/author/categories (keep it under 160 characters) that summarizes the post
in plain text and ensure it does not contain markdown or images.

---

Nitpick comments:
In `@jekyll/_posts/2026-04-01-building-wechat-group-bot-with-wechaty-padlocal.md`:
- Line 50: Rephrase the Chinese sentence "提交博客或代码 PR 被合并" to a grammatically
natural form; locate the line containing "💡 长期免费 Token:成为 Wechaty 贡献者(提交博客或代码
PR 被合并)后可向官方申请长期 Token。" and replace the parenthetical with a smoother phrasing
such as "(提交的博客或代码 PR 被合并后)" or another natural alternative that keeps the
meaning intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 200558a1-a134-495b-9370-2eb2c3addae2

📥 Commits

Reviewing files that changed from the base of the PR and between 5fd378a and 4d8735b.

⛔ Files ignored due to path filters (1)
  • jekyll/assets/2026/04-wechaty-padlocal-group-bot/cover.png is excluded by !**/*.png
📒 Files selected for processing (3)
  • jekyll/_contributors/dihe709155244.md
  • jekyll/_posts/2026-04-01-building-wechat-group-bot-with-wechaty-padlocal.md
  • jekyll/assets/contributors/dihe709155244/avatar.webp

## Contact me

- Github: <https://github.com/zzzyer>
- Email:<709155244@qq.com> No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add trailing newline at end of file.

Files should end with a single newline character as per Markdown best practices.

🔧 Proposed fix
 - Email:<709155244@qq.com>
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Email:<709155244@qq.com>
- Email:<709155244@qq.com>
🧰 Tools
🪛 markdownlint-cli2 (0.22.0)

[warning] 16-16: Files should end with a single newline character

(MD047, single-trailing-newline)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@jekyll/_contributors/dihe709155244.md` at line 16, Add a single trailing
newline character at the end of the file so it ends with exactly one newline;
specifically ensure the last line containing "Email:<709155244@qq.com>" is
followed by a newline (no extra blank lines) to satisfy Markdown/file EOF
conventions.

@dihe709155244
Copy link
Copy Markdown
Author

/easycla

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 8, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
jekyll/_contributors/dihe709155244.md (1)

12-12: ⚠️ Potential issue | 🟡 Minor

Add trailing newline at end of file.

The file should end with a single newline character to comply with Markdown best practices.

📝 Proposed fix
 - Email: <709155244@qq.com>
+
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@jekyll/_contributors/dihe709155244.md` at line 12, The file
jekyll/_contributors/dihe709155244.md is missing a trailing newline; open the
file and ensure it ends with exactly one newline character (i.e., add a single
blank line/newline at the end of the file) so the Markdown file conforms to
POSIX/Markdown trailing-newline conventions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@jekyll/_contributors/dihe709155244.md`:
- Line 12: The file jekyll/_contributors/dihe709155244.md is missing a trailing
newline; open the file and ensure it ends with exactly one newline character
(i.e., add a single blank line/newline at the end of the file) so the Markdown
file conforms to POSIX/Markdown trailing-newline conventions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2da478c2-4e85-4619-b6ff-1df66d10932c

📥 Commits

Reviewing files that changed from the base of the PR and between 4d8735b and feeeabc.

📒 Files selected for processing (3)
  • jekyll/_contributors/dihe709155244.md
  • jekyll/_posts/2026-04-01-building-wechat-group-bot-with-wechaty-padlocal.md
  • jekyll/assets/2026/04-building-wechat-group-bot-with-wechaty-padlocal/post-teaser-image.webp

@dihe709155244 dihe709155244 force-pushed the add-padlocal-group-bot-blog branch from feeeabc to c4d1795 Compare April 8, 2026 11:43
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
jekyll/_contributors/dihe709155244.md (1)

12-12: ⚠️ Potential issue | 🟡 Minor

Add a single trailing newline at end of file.

markdownlint MD047 is still triggered; please ensure the file ends with exactly one newline character.

As per coding guidelines: Markdown linting requires removing trailing whitespace and keeping markdown formatting clean, including proper EOF newline conventions.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@jekyll/_contributors/dihe709155244.md` at line 12, The file containing the
line "Email: <709155244@qq.com>" (dihe709155244.md) currently does not end with
exactly one newline; open that Markdown file, remove any extra trailing blank
lines or trailing whitespace at EOF and ensure there is exactly one newline
character at the end of the file so markdownlint MD047 is satisfied.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@jekyll/_posts/2026-04-01-building-wechat-group-bot-with-wechaty-padlocal.md`:
- Line 50: 将句子中生硬的片段“提交博客或代码 PR 被合并”改为更通顺的表述,例如把整句改为“成为 Wechaty 贡献者(提交的博客或代码 PR
被合并后)可向官方申请长期 Token”或“成为 Wechaty 贡献者(提交博客或代码并被合并的 PR)后可向官方申请长期
Token”;定位并替换原文中包含“提交博客或代码 PR 被合并”的那一行。

---

Duplicate comments:
In `@jekyll/_contributors/dihe709155244.md`:
- Line 12: The file containing the line "Email: <709155244@qq.com>"
(dihe709155244.md) currently does not end with exactly one newline; open that
Markdown file, remove any extra trailing blank lines or trailing whitespace at
EOF and ensure there is exactly one newline character at the end of the file so
markdownlint MD047 is satisfied.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 980d0894-098e-4c2a-a4f4-ff92b568171b

📥 Commits

Reviewing files that changed from the base of the PR and between feeeabc and c4d1795.

📒 Files selected for processing (3)
  • jekyll/_contributors/dihe709155244.md
  • jekyll/_posts/2026-04-01-building-wechat-group-bot-with-wechaty-padlocal.md
  • jekyll/assets/2026/04-building-wechat-group-bot-with-wechaty-padlocal/post-teaser-image.webp

2. 注册账号,申请 **7天免费试用 Token**
3. Token 格式形如:`puppet_padlocal_xxxxxxxxxxxxxxxx`

> 💡 长期免费 Token:成为 Wechaty 贡献者(提交博客或代码 PR 被合并)后可向官方申请长期 Token。
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Polish Chinese wording for better grammar.

“提交博客或代码 PR 被合并” is slightly awkward; a more natural phrasing improves readability.

Suggested patch
-> 💡 长期免费 Token:成为 Wechaty 贡献者(提交博客或代码 PR 被合并)后可向官方申请长期 Token。
+> 💡 长期免费 Token:成为 Wechaty 贡献者(提交的博客或代码 PR 可被合并)后,可向官方申请长期 Token。
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
> 💡 长期免费 Token:成为 Wechaty 贡献者(提交博客或代码 PR 被合并)后可向官方申请长期 Token。
> 💡 长期免费 Token:成为 Wechaty 贡献者(提交的博客或代码 PR 可被合并)后,可向官方申请长期 Token。
🧰 Tools
🪛 LanguageTool

[uncategorized] ~50-~50: 能愿动词不能成为‘把’字句、‘被’字句的谓语动词。应该是:"可被……合并"。
Context: ...💡 长期免费 Token:成为 Wechaty 贡献者(提交博客或代码 PR 被合并)后可向官方申请长期 Token。 ### 第二步:初始化项目 ```bash m...

(wa3)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@jekyll/_posts/2026-04-01-building-wechat-group-bot-with-wechaty-padlocal.md`
at line 50, 将句子中生硬的片段“提交博客或代码 PR 被合并”改为更通顺的表述,例如把整句改为“成为 Wechaty 贡献者(提交的博客或代码 PR
被合并后)可向官方申请长期 Token”或“成为 Wechaty 贡献者(提交博客或代码并被合并的 PR)后可向官方申请长期
Token”;定位并替换原文中包含“提交博客或代码 PR 被合并”的那一行。

@dihe709155244 dihe709155244 force-pushed the add-padlocal-group-bot-blog branch from c4d1795 to 12a91c4 Compare April 8, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants