Skip to content
Branch: master
Find file History


The wechaty-getting-started/examples directory is provided for people who want to learn coding wechaty, for them to get an easier start. If you start coding wechaty for the first time, we highly recommend to start with the starter-bot.js, the best starter template for you.

Filename Description 描述
starter-bot.js The Best Starter Template for You


  • All the other examples have been carefully arranged into different categories so as to better guide you for what to choose/see, as you move along.
  • In order to keep things simple, we just put the examples in the subdirectory of the examples/ directory, so that they each can just run out-of-the-box.
  • We also recommend that you at least read through them all, before starting coding, for a even better, smoother ride.
  • More demos are welcome. If you have anything interesting to add, please don't hesitate to reach out to us.

Furthermore, after some careful thinking, the Wechaty author, Huan LI, feels it's necessary to add the examples as vanilla Javascript example, instead of Typescript ones. So if you want to contribute one, please consider so.


Wechaty Basic Functions (demos under the basic/ directory)

FileName Description 描述
the-worlds-shortest-chatbot-code-in-6-lines.js The very first wechaty example showcasing how easy it is to get started
ding-dong-bot.js Practical example illustrates on how to do message handling
contact-bot.js List all contacts by Wechat ID & Name 在终端下输出微信号下所有联系的人微信ID和昵称。


Wechaty Advanced Functions (demos under the advanced/ directory)

FileName Description 描述
demo-in-tutorial.js the demo bot from the tutorial
busy-bot.js auto response "busy" message for you when you are
media-file-bot.js Save Media Attachment in Message to local files 将消息中的文件、图片、视频等非文本信息存到本地。
room-bot.js,room-say-cli.js Practical example illustrates on how to do room handling
friend-bot.js Practical example illustrates on how to do friend handling
gist-bot/ Best template for bigger modules, with each handler in separated files


Wechaty Integrated with Other Modules/Services (demos under the professional/ directory)

FileName Description 描述
hot-import-bot/ Using Hot Module Reload(HMR) for Wechaty Listeners
ctrl-c-signal-bot.ts Ctrl-C signal handling demo
monster-bot/ demo that tried to include everything -- message, room, HMR & signal handling, with each handler in separated files
api-ai-bot.ts Wechaty bot that uses brain
speech-to-text-bot.ts bot that uses baidu speech (
tuling123-bot.ts Connect to tuling123 chatbot 接入tuling123机器人
telegram-roger-bot.js single bot that runs under/for both Telegram and WeChaty
blessed-twins-bot/ Wechaty multi-instance support (v0.16+) demo
You can’t perform that action at this time.