{"id":13406686,"url":"https://github.com/wechaty/wechaty","last_synced_at":"2025-05-12T20:40:03.206Z","repository":{"id":37584496,"uuid":"57602001","full_name":"wechaty/wechaty","owner":"wechaty","description":"Conversational RPA SDK for Chatbot Makers. Join our Discord: https://discord.gg/7q8NBZbQzt","archived":false,"fork":false,"pushed_at":"2025-04-29T09:29:24.000Z","size":9017,"stargazers_count":21479,"open_issues_count":180,"forks_count":2685,"subscribers_count":384,"default_branch":"main","last_synced_at":"2025-05-05T16:04:21.042Z","etag":null,"topics":["bot","chatbot","conversational-ai","framework","qq","robotics","wechat","wechaty","whatsapp"],"latest_commit_sha":null,"homepage":"https://wechaty.js.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wechaty.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"wechaty"}},"created_at":"2016-05-01T14:36:45.000Z","updated_at":"2025-05-05T15:49:55.000Z","dependencies_parsed_at":"2023-02-11T23:00:20.972Z","dependency_job_id":"65e2737f-0205-4db5-93bb-0f4ad5856f4e","html_url":"https://github.com/wechaty/wechaty","commit_stats":{"total_commits":6564,"total_committers":67,"mean_commits":97.97014925373135,"dds":"0.12081048141377204","last_synced_commit":"3dba2be9317a9a57d058cc79bbe9bfd3435864ae"},"previous_names":["chatie/wechaty","zixia/wechaty"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wechaty%2Fwechaty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wechaty%2Fwechaty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wechaty%2Fwechaty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wechaty%2Fwechaty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wechaty","download_url":"https://codeload.github.com/wechaty/wechaty/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252753052,"owners_count":21798906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","chatbot","conversational-ai","framework","qq","robotics","wechat","wechaty","whatsapp"],"created_at":"2024-07-30T19:02:36.517Z","updated_at":"2025-05-12T20:40:03.110Z","avatar_url":"https://github.com/wechaty.png","language":"TypeScript","readme":"# Wechaty [![Join Wechaty Discord Developer Community](https://img.shields.io/discord/916984413944967180?logo=discord\u0026style=flat)](https://discord.gg/7q8NBZbQzt) [![NPM Version](https://img.shields.io/npm/v/wechaty?color=brightgreen)](https://www.npmjs.com/package/wechaty) [![NPM](https://github.com/wechaty/wechaty/workflows/NPM/badge.svg)](https://github.com/wechaty/wechaty/actions?query=workflow%3ANPM) [![Docker](https://github.com/wechaty/wechaty/workflows/Docker/badge.svg)](https://github.com/wechaty/wechaty/actions?query=workflow%3ADocker)\n\n[![Wechaty](https://wechaty.js.org/img/wechaty-logo.svg)](https://wechaty.js.org)\n\n[![Downloads](https://img.shields.io/npm/dm/wechaty.svg?style=flat-square)](https://www.npmjs.com/package/wechaty)\n[![GitHub stars](https://img.shields.io/github/stars/wechaty/wechaty.svg?label=github%20stars)](https://github.com/wechaty/wechaty)\n[![Docker Pulls](https://img.shields.io/docker/pulls/wechaty/wechaty.svg?maxAge=2592000)](https://hub.docker.com/r/wechaty/wechaty/)\n[![ES Modules](https://img.shields.io/badge/ES-Modules-orange)](https://github.com/Chatie/tsconfig/issues/16)\n\n[![TypeScript](https://img.shields.io/badge/--3178C6?logo=typescript\u0026logoColor=ffffff)](https://wechaty.js.org/docs/polyglot/typescript/)\n[![JavaScript](https://img.shields.io/badge/--F7DF1E?logo=javascript\u0026logoColor=000)](https://wechaty.js.org/docs/polyglot/typescript/)\n[![Python](https://img.shields.io/badge/--3670A0?logo=python\u0026logoColor=ffdd54)](https://wechaty.js.org/docs/polyglot/python/)\n[![Go](https://img.shields.io/badge/--00ADD8?logo=go\u0026logoColor=white)](https://wechaty.js.org/docs/polyglot/go/)\n[![Java](https://img.shields.io/badge/--red?logo=java\u0026logoColor=white)](https://wechaty.js.org/docs/polyglot/java/)\n[![.NET](https://img.shields.io/badge/--5C2D91?logo=dotnet\u0026logoColor=white)](https://wechaty.js.org/docs/polyglot/dotnet/)\n[![PHP](https://img.shields.io/badge/--777BB4?logo=php\u0026logoColor=white)](https://wechaty.js.org/docs/polyglot/php/)\n[![Rust](https://img.shields.io/badge/--000000?logo=rust\u0026logoColor=white)](https://wechaty.js.org/docs/polyglot/rust/)\n[![Scala](https://img.shields.io/badge/--DC322F?logo=scala\u0026logoColor=white)](https://wechaty.js.org/docs/polyglot/scala/)\n\n[![WeChat](https://img.shields.io/badge/--07C160?logo=wechat\u0026logoColor=white)](https://wechaty.js.org/docs/puppet-providers/wechat)\n[![Whatsapp](https://img.shields.io/badge/--25D366?logo=whatsapp\u0026logoColor=white)](https://wechaty.js.org/docs/puppet-providers/whatsapp)\n\n\u003c!--\n[![TikTok](https://img.shields.io/badge/--000000?logo=tiktok\u0026logoColor=white)](https://wechaty.js.org/docs/puppet-providers/tiktok)\n[![Line](https://img.shields.io/badge/--00C300?logo=line\u0026logoColor=white)](https://wechaty.js.org/docs/puppet-providers/line)\n[![Telegram](https://img.shields.io/badge/--2CA5E0?logo=telegram\u0026logoColor=white)](https://wechaty.js.org/docs/puppet-providers/telegram)\n[![Gitter](https://badges.gitter.im/wechaty/wechaty.svg)](https://gitter.im/wechaty/wechaty?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n[![Gitter room](https://badgen.net/gitter/members/wechaty/wechaty)](https://gitter.im/wechaty/wechaty?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n[![Telegram Wechaty Channel](https://img.shields.io/badge/chat-on%20telegram-blue)](https://t.me/wechaty)\n--\u003e\n\n## Elevator Pitch\n\nWechaty is a conversational RPA SDK that simplifies the process of building chatbots. It's like a Swiss Army knife for chatbot development, providing a universal interface to various messaging platforms such as WhatsApp, WeChat, and more. With Wechaty, you write your bot code once, and it runs on any of the supported platforms. This means you can focus on creating engaging conversational experiences without worrying about the underlying complexities of each platform's API. It's open-source, easy to use, and backed by a vibrant community that's ready to help you bring your chatbot ideas to life.\n\n## Connecting Chatbots\n\nWechaty is an RPA (Robotic Process Automation) SDK for Chatbot Makers which can help you create a bot in 6 lines of [JavaScript](https://GitHub.com/Wechaty/wechaty), [Python](https://GitHub.com/Wechaty/python-wechaty/), [Go](https://GitHub.com/Wechaty/go-wechaty/), and [Java](https://GitHub.com/Wechaty/java-wechaty/), with cross-platform support including [Linux, Windows, MacOS](https://github.com/wechaty/wechaty/actions?query=workflow%3ANPM), and [Docker](https://github.com/wechaty/wechaty/actions?query=workflow%3ADocker).\n\n:spider_web: \u003chttps://wechaty.js.org\u003e  \n:octocat: \u003chttps://github.com/Wechaty/wechaty\u003e  \n:beetle: \u003chttps://github.com/Wechaty/wechaty/issues\u003e  \n:book: \u003chttps://github.com/Wechaty/wechaty-getting-started\u003e  \n:whale: \u003chttps://hub.docker.com/r/wechaty/wechaty\u003e  \n\n## Breaking News\n\n- [重磅：绕过登录限制，wechaty免费版web协议重放荣光, @gengchen528, Apr 13, 2021](https://wechaty.js.org/2021/04/13/wechaty-uos-web/)\n\n## Voice of Developers\n\n\u003e \"Wechaty is a great solution; I believe there would be much more users who recognize it.\" [link](https://github.com/Wechaty/wechaty/pull/310#issuecomment-285574472)  \n\u003e \u0026mdash; \u003ccite\u003e@Gcaufy, Tencent Engineer, Author of [WePY](https://github.com/Tencent/wepy)\u003c/cite\u003e\n\u003e\n\u003e \"太好用，好用的想哭\"  \n\u003e \u0026mdash; \u003ccite\u003e@xinbenlv, Google Engineer, Founder of HaoShiYou.org\u003c/cite\u003e\n\u003e\n\u003e ”好用到哭“——你们对得起这个评价！ [link](https://github.com/bigbrother666sh/shezhangbujianle#%E8%87%B4%E6%95%AC)  \n\u003e \u0026mdash; \u003ccite\u003e[@bigbrother666sh](https://github.com/bigbrother666sh), creator of《社长不见了》剧本杀 NPC DM\u003c/cite\u003e\n\u003e\n\u003e \"最好的微信开发库\" [link](http://weibo.com/3296245513/Ec4iNp9Ld?type=comment)  \n\u003e \u0026mdash; \u003ccite\u003e@Jarvis, Baidu Engineer\u003c/cite\u003e\n\u003e\n\u003e \"Wechaty让运营人员更多的时间思考如何进行活动策划、留存用户，商业变现\" [link](http://mp.weixin.qq.com/s/dWHAj8XtiKG-1fIS5Og79g)  \n\u003e \u0026mdash; \u003ccite\u003e@lijiarui, Founder \u0026 CEO of Juzi.BOT.\u003c/cite\u003e\n\u003e\n\u003e \"If you know js ... try Wechaty. It's easy to use.\"  \n\u003e \u0026mdash; \u003ccite\u003e@Urinx Uri Lee, Author of [WeixinBot(Python)](https://github.com/Urinx/WeixinBot)\u003c/cite\u003e\n\u003e\n\u003e \"Wechaty is a good project; I hope it can continue! Therefore, I became a contributor in open collective.\"  \n\u003e \u0026mdash; \u003ccite\u003e[@Simple](https://github.com/mrwhh)\u003c/cite\u003e\n\nSee more at [Wiki:Voice Of Developer](https://github.com/Wechaty/wechaty/wiki/Voice%20Of%20Developer)\n\n### Join Us on Discord\n\n[![Join Wechaty Discord Developer Community](https://img.shields.io/discord/916984413944967180?logo=discord\u0026style=flat)](https://discord.gg/7q8NBZbQzt)\n[![Wechaty Discord](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fdiscord.com%2Fapi%2Finvites%2F7q8NBZbQzt%3Fwith_counts%3Dtrue\u0026query=%24.approximate_member_count\u0026logo=discord\u0026logoColor=white\u0026label=Users%20Total\u0026color=green\u0026style=flat)](https://discord.gg/7q8NBZbQzt)\n\nWechaty is used in many ChatBot projects by thousands of developers. To talk with other developers, scan the QR Code below and join our **Wechaty Developer Community**.\n\n![Wechaty Discord Community QR Code](https://wechaty.js.org/img/discord-qrcode.svg)\n\nScan now because other Wechaty developers want to talk with you, too!\n\n### Resource\n\nWechaty has already held lots of talks and got a lot of blogs in the past years; here are all of the wechaty resources:\n\n- :video_camera: [Youtube Playlist: Watch all of the talk videos related with Wechaty](https://www.youtube.com/playlist?list=PL8hd9KDTdarDXf_Rxtr8meKhxtgcXMInh)\n- :page_with_curl: [Full Docs](https://wechaty.js.org/)\n- :bulb: [Blog: See how developers use wechaty to build fantastic projects!](https://wechaty.github.io/)\n- :beginner: [Wechaty-Getting-Started:Wechaty Starter Project Template that Works Out-of-the-Box](https://github.com/wechaty/wechaty-getting-started)\n- :tada: [Wechaty Contributor List: Thanks for their contribution!](https://github.com/wechaty/wechaty/wiki/Contributors)\n- :gift: [Juzibot Support Wechaty: Know everything about Wechaty](https://github.com/juzibot/Welcome/wiki/Everything-about-Wechaty)\n\n## :rocket: The World's Shortest ChatBot Code: 6 lines of JavaScript\n\n```javascript\n\nimport { WechatyBuilder } from 'wechaty'\n\nconst wechaty = WechatyBuilder.build() // get a Wechaty instance\nwechaty\n  .on('scan', (qrcode, status) =\u003e console.log(`Scan QR Code to login: ${status}\\nhttps://wechaty.js.org/qrcode/${encodeURIComponent(qrcode)}`))\n  .on('login',            user =\u003e console.log(`User ${user} logged in`))\n  .on('message',       message =\u003e console.log(`Message: ${message}`))\nwechaty.start()\n```\n\n\u003e **Notice: Wechaty requires Node.js version \u003e= 16**\n\nThis bot can log all messages to the console after login by the scan.\n\nYou can find Wechaty's Official Examples at [examples/ding-dong-bot.ts](examples/ding-dong-bot.ts) and more from our [Example Directory](https://github.com/Wechaty/wechaty-getting-started/blob/main/examples/).\n\n## :checkered_flag: Requirements\n\n1. Node.js version 16+\n1. NPM version 7+\n1. TypeScript version 4.4+\n\n## Getting Started\n\n[![node](https://img.shields.io/node/v/wechaty.svg?maxAge=604800)](https://nodejs.org/)\n\n- Wechaty Starter Repository - \u003chttps://github.com/wechaty/wechaty-getting-started\u003e\n\nWe have a Wechaty starter repository for beginners with the simplest setting. It will be **work** out-of-the-box after you `clone` \u0026 `npm install` \u0026 `npm start`.\n\nIf you are new to Wechaty and want to try it the first time, we'd like to strong recommend you starting from this repository, and using it as your starter template for your project.\n\nOtherwise, please saved the above _The World's Shortest ChatBot Code: 6 lines of JavaScript_ example to a file named `bot.js` before you can use either NPM or Docker to run it.\n\n### 1. Npm\n\n[![NPM Version](https://img.shields.io/npm/v/wechaty?color=brightgreen\u0026label=wechaty%40latest)](https://www.npmjs.com/package/wechaty)\n[![npm (tag)](https://img.shields.io/npm/v/wechaty/next?color=yellow\u0026label=wechaty%40next)](https://www.npmjs.com/package/wechaty?activeTab=versions)\n\n[![Downloads](https://img.shields.io/npm/dm/wechaty.svg?style=flat-square)](https://www.npmjs.com/package/wechaty)\n[![install size](https://packagephobia.now.sh/badge?p=wechaty)](https://packagephobia.now.sh/result?p=wechaty)\n\n```shell\nnpm init\nnpm install wechaty\n\n# create your first bot.js file, you can copy/paste from the above \"The World's Shortest ChatBot Code: 6 lines of JavaScript\"\n# then:\nnode bot.js\n```\n\n### 2. Docker\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/wechaty/wechaty.svg?maxAge=2592000)](https://hub.docker.com/r/wechaty/wechaty/)\n[![Docker Layers](https://images.microbadger.com/badges/image/wechaty/wechaty.svg)](https://microbadger.com/#/images/wechaty/wechaty)\n\n- Wechaty Starter Repository for Docker - \u003chttps://github.com/wechaty/docker-wechaty-getting-started\u003e\n\n\u003e Wechaty Docker supports both JavaScript and TypeScript. To use TypeScript just write in TypeScript and save with extension name `.ts`, no need to compile because we use `ts-node` to run it.\n\n2.1. Run JavaScript\n\n```shell\n# for JavaScript\ndocker run -ti --rm --volume=\"$(pwd)\":/bot wechaty/wechaty bot.js\n```\n\n2.2. Run TypeScript\n\n```shell\n# for TypeScript\ndocker run -ti --rm --volume=\"$(pwd)\":/bot wechaty/wechaty bot.ts\n```\n\n\u003e Learn more about Wechaty Docker at [Wiki:Docker](https://github.com/Wechaty/wechaty/wiki/Docker).\n\n### 3. Switch Protocol(Puppet)\n\nWechaty is very powerful that it can run over different protocols. You can specify the protocol by set the environment variable `WECHATY_PUPPET` to different puppet provider.\n\nIf you cannot use Web protocol, you can apply other protocols following the instruction here: \u003chttps://github.com/wechaty/wechaty/wiki/Support-Developers\u003e We provide free token to support developers build a valuable WeChat chatbot.\n\nCurrently we support the following [puppet providers](https://wechaty.js.org/docs/puppet-services/) :\n\n| Protocol | Puppet Provider | Environment Variable |\n| --- | --- | --- |\n| Web | [PuppetPuppeteer](https://github.com/wechaty/wechaty-puppet-puppeteer) | `export WECHATY_PUPPET=wechaty-puppet-puppeteer` |\n| Windows | [PuppetWorkPro](https://github.com/RPAChat/workpro-getting-started) | `export WECHATY_PUPPET=wechaty-puppet-service` |\n| Mock | [PuppetMock](https://github.com/wechaty/wechaty-puppet-mock) | `export WECHATY_PUPPET=wechaty-puppet-mock` |\n| Web | [PuppetWechat4u](https://github.com/wechaty/wechaty-puppet-wechat4u) | `export WECHATY_PUPPET=wechaty-puppet-wechat4u` |\n| iPad | [PuppetRock](https://github.com/wechaty/puppet-service-providers) | `export WECHATY_PUPPET=wechaty-puppet-service` |\n| iPad | [PuppetPadLocal](https://github.com/wechaty/puppet-service-providers) | `export WECHATY_PUPPET=wechaty-puppet-service` |\n| Windows | [PuppetDonut](https://github.com/wechaty/puppet-service-providers) | `export WECHATY_PUPPET=wechaty-puppet-service` |\n| iPad | ~~PuppetPadpro~~ **DEPRECATED** | `export WECHATY_PUPPET=wechaty-puppet-padpro` |\n| iPad | ~~PuppetPadchat~~ **DEPRECATED** | `export WECHATY_PUPPET=wechaty-puppet-padchat` |\n| iPad | ~~PuppetPadplus~~ **DEPRECATED** | `export WECHATY_PUPPET=wechaty-puppet-padplus` |\n| Mac | ~~PuppetMacpro~~ **DEPRECATED** | `export WECHATY_PUPPET=wechaty-puppet-macpro` |\n| Windows | ~~PuppetWxwork~~ **DEPRECATED** | `export WECHATY_PUPPET=wechaty-puppet-service` |\n\nLearn more about Wechaty Puppet from the Puppet Wiki:\n\n1. Puppet Directory: \u003chttps://github.com/Wechaty/wechaty-puppet/wiki/Directory\u003e\n1. Puppet Compatibility: \u003chttps://github.com/Wechaty/wechaty-puppet/wiki/Compatibility\u003e\n\n## :guitar: API\n\nRead the Full Documentation at [Wechaty Official API Reference](https://wechaty.github.io/wechaty/)\n\n### 1 Class `Wechaty`\n\nMain bot class.\n\nA `Bot` is a Wechaty instance that control a specific [wechaty-puppet](https://wechaty.js.org/docs/specifications/puppet/).\n\n- `new Wechaty(options?: WechatyOptions)`\n    1. `options.name?: string` the name of this bot(optional)\n    2. `options.puppet?: string` select which puppet provider we want to use. must be one of the:\n        1. [wechaty-puppet-wechat](https://github.com/Wechaty/wechaty-puppet-wechat) - Angular Hook for Web Wechat\n        2. [wechaty-puppet-wechat4u](https://github.com/Wechaty/wechaty-puppet-wechat4u) - HTTP API for Web Wechat\n        3. [wechaty-puppet-padpro](https://github.com/botorange/wechaty-puppet-padpro) - iPad App Protocol\n        4. [wechaty-puppet-ioscat](https://github.com/linyimin-bupt/wechaty-puppet-ioscat) - iPhone App Hook\n        5. [wechaty-puppet-mock](https://github.com/Wechaty/wechaty-puppet-mock) - Mock for Testing\n    3. `options.puppetOptions?: PuppetOptions` options for the puppet provider.\n\n| Wechaty | API | Description |\n| :--- | :--- | :---        |\n| event | [`login`](https://wechaty.github.io/wechaty/#Wechaty+on) | emit after bot login full successful |\n| event | [`logout`](https://wechaty.github.io/wechaty/#Wechaty+on) | emit after the bot log out |\n| event | [`friendship`](https://wechaty.github.io/wechaty/#Wechaty+on) | emit when someone sends bot a friend request|\n| event | [`message`](https://wechaty.github.io/wechaty/#Wechaty+on) | emit when there's a new message |\n| event | [`room-join`](https://wechaty.github.io/wechaty/#Wechaty+on) | emit when anyone join any room |\n| event | [`room-topic`](https://wechaty.github.io/wechaty/#Wechaty+on) | emit when someone change room topic |\n| event | [`room-leave`](https://wechaty.github.io/wechaty/#Wechaty+on) | emit when anyone leave the room |\n| event | [`room-invite`](https://wechaty.github.io/wechaty/#Wechaty+on) | emit when there is a room invitation |\n| event | [`scan`](https://wechaty.github.io/wechaty/#Wechaty+on) | emit when the bot needs to show you a QR Code for scanning |\n| method | [`start(): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#Wechaty+start) | start the bot |\n| method | [`stop(): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#Wechaty+stop) | stop the bot |\n| method | [`logonoff(): boolean`](https://wechaty.github.io/wechaty/#Wechaty+logonoff) | bot login status |\n| method | [`logout(): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#Wechaty+logout) | logout the bot |\n| method | [`currentUser(): ContactSelf`](https://wechaty.github.io/wechaty/#Wechaty+currentUser) | get the login-ed bot contact |\n| method | [`say(text: string): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#Wechaty+say) | let bot say `text` to itself |\n\n### 2 Class `Contact`\n\nAll wechat contacts(friends/non-friends) will be encapsulated as a Contact.\n\n| Contact | API | Description |\n| :--- | :--- | :---        |\n| static | [`find(query: string): Promise\u003cnull \\| Contact\u003e`](https://wechaty.github.io/wechaty/#Contact.find) | find contact by name or alias, if the result more than one, return the first one. |\n| static | [`findAll(query: string): Promise\u003cContact[]\u003e`](https://wechaty.github.io/wechaty/#Contact.findAll) | find contact by `name` or `alias` |\n| static | [`load(query: string): Contact`](https://wechaty.github.io/wechaty/#Contact.load) | get contact by id |\n| property | `id: readonly string` | get contact id |\n| method | [`sync(): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#Contact+sync) | force reload data for contact , sync data from lowlevel API again|\n| method | [`say(text: string): Promise\u003cvoid \\| Message\u003e`](https://wechaty.github.io/wechaty/#Contact+say) | send text, Contact, or file to contact, return the message which the bot sent (only `puppet-padplus` supported). |\n| method | [`self(): boolean`](https://wechaty.github.io/wechaty/#Contact+self) | check if contact is self |\n| method | [`name(): string`](https://wechaty.github.io/wechaty/#Contact+name) | get the name from a contact |\n| method | [`alias(): Promise\u003cstring\u003e`](https://wechaty.github.io/wechaty/#Contact+alias) | get the alias for a contact |\n| method | [`alias(newAlias: string): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#Contact+alias) | set or delete the alias for a contact |\n| method | [`friend(): boolean`](https://wechaty.github.io/wechaty/#Contact+friend) | check if contact is friend |\n| method | [`type(): ContactType`](https://wechaty.github.io/wechaty/#Contact+type) | return the type of the Contact |\n| method | [`province(): string`](https://wechaty.github.io/wechaty/#Contact+province) | get the region 'province' from a contact |\n| method | [`city(): string`](https://wechaty.github.io/wechaty/#Contact+city) | get the region 'city' from a contact |\n| method | [`avatar(): Promise\u003cFileBox\u003e`](https://wechaty.github.io/wechaty/#Contact+avatar) | get avatar picture file stream |\n| method | [`gender(): ContactGender`](https://wechaty.github.io/wechaty/#Contact+gender) | get gender from a contact |\n\n#### 2.1 Class `ContactSelf`\n\nClass `ContactSelf` is extended from `Contact`.\n\n| ContactSelf | API | Description |\n| :--- | :--- | :---        |\n| method | [`avatar(file: FileBox): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#ContactSelf+avatar) | set avatar for bot |\n| method | [`qrcode(): Promise\u003cstring\u003e`](https://wechaty.github.io/wechaty/#ContactSelf+qrcode) | get qrcode for bot |\n| method | [`signature(text: string): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#ContactSelf+signature) | set signature for bot |\n\n#### 2.2 Class `Friendship`\n\nSend, receive friend request, and friend confirmation events.\n\n| Friendship | API | Description |\n| :--- | :--- | :---        |\n| static | [`add(contact: Contact, hello?: string): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#Friendship.add) | send a friend invitation to contact |\n| method | [`accept(): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#Friendship+accept) | accept Friend Request |\n| method | [`hello(): string`](https://wechaty.github.io/wechaty/#Friendship+hello) | get the hello string from a friendship invitation |\n| method | [`contact(): Contact`](https://wechaty.github.io/wechaty/#Friendship+contact) | get the contact from friendship |\n| method | [`type(): FriendshipType`](https://wechaty.github.io/wechaty/#Friendship+type) | return the Friendship Type(unknown, confirm, receive, verify) |\n\n### 3 Class `Message`\n\nAll wechat messages will be encapsulated as a Message.\n\n| Message | API | Description |\n| :--- | :--- | :---        |\n| static | [`find(query: string): Promise\u003cnull \\| Message\u003e`](https://wechaty.github.io/wechaty/#Message.find) | find message in cache and return the first one |\n| static | [`findAll(query: string): Promise\u003cMessage[]\u003e`](https://wechaty.github.io/wechaty/#Message.findAll) | find messages in cache, return a message list |\n| method | [`from(): Contact`](https://wechaty.github.io/wechaty/#Message+from) | get the sender from a message |\n| method | [`to(): Contact`](https://wechaty.github.io/wechaty/#Message+to) | get the destination of the message |\n| method | [`room(): null \\| Room`](https://wechaty.github.io/wechaty/#Message+room) | get the room from the message.(If the message is not in a room, then will return `null`) |\n| method | [`text(): string`](https://wechaty.github.io/wechaty/#Message+text) | get the text content of the message |\n| method | [`say(text: string): Promise\u003cvoid \\| Message\u003e`](https://wechaty.github.io/wechaty/#Message+say) | reply a Text, Media File , or contact message to the sender, return the message which the bot sent (only `puppet-padplus` supported). |\n| method | [`type(): MessageType`](https://wechaty.github.io/wechaty/#Message+type) | get the type from the message |\n| method | [`self(): boolean`](https://wechaty.github.io/wechaty/#Message+self) | check if a message is sent by self |\n| method | [`mention(): Contact[]`](https://wechaty.github.io/wechaty/#Message+mention) | get message mentioned contactList. |\n| method | [`mentionSelf(): boolean`](https://wechaty.github.io/wechaty/#Message+mentionSelf) | check if a message is mention self |\n| method | [`forward(to: Contact): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#Message+forward) | Forward the received message |\n| method | [`age(): number`](https://wechaty.github.io/wechaty/#Message+age) | the number of seconds since it has been created |\n| method | [`date(): Date`](https://wechaty.github.io/wechaty/#Message+date) | the time it was created |\n| method | [`toFileBox(): Promise\u003cFileBox\u003e`](https://wechaty.github.io/wechaty/#Message+toFileBox) | extract the Media File from the Message, and put it into the FileBox. |\n| method | [`toContact(): Promise\u003cContact\u003e`](https://wechaty.github.io/wechaty/#Message+toContact) | get Share Card of the Message |\n\n### 4 Class `Room`\n\nAll wechat rooms(groups) will be encapsulated as a Room.\n\n| Room | API | Description |\n| :--- | :--- | :---        |\n| static | [`create(contactList: Contact[], topic?: string): Promise\u003cRoom\u003e`](https://wechaty.github.io/wechaty/#Room.create) | create a new room |\n| static | [`find(query: string): Promise\u003cnull \\| Room\u003e`](https://wechaty.github.io/wechaty/#Room.find) | Try to find a room by filter. If get many, return the first one. |\n| static | [`findAll(query: string): Promise\u003cRoom[]\u003e`](https://wechaty.github.io/wechaty/#Room.findAll) | Find all contacts in a room |\n| static | [`load(query: string): Room`](https://wechaty.github.io/wechaty/#Room.load) | load room by room id |\n| property | `id: readonly string` |  |\n| event | [`join`](https://wechaty.github.io/wechaty/#Room+on) | emit when anyone join any room |\n| event | [`topic`](https://wechaty.github.io/wechaty/#Room+on) | emit when someone change room topic |\n| event | [`leave`](https://wechaty.github.io/wechaty/#Room+on) | emit when anyone leave the room |\n| event | [`invite`](https://wechaty.github.io/wechaty/#Room+on) | emit when receive a room invitation |\n| method | [`sync(): \u003cPromise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#Room+sync) | force reload data for room, sync data from lowlevel API again.\n| method | [`say(text: string): Promise\u003cvoid \\| Message\u003e`](https://wechaty.github.io/wechaty/#Room+say) | Send text,media file, contact card, or text with mention @mention contact inside Room, return the message which the bot sent (only `puppet-padplus` supported). |\n| method | [`add(contact: Contact): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#Room+add) | Add contact in a room |\n| method | [`del(contact: Contact): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#Room+del) | Delete a contact from the room |\n| method | [`quit(): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#Room+quit) | Bot quit the room itself |\n| method | [`topic(): Promise\u003cstring\u003e`](https://wechaty.github.io/wechaty/#Room+topic) | GET topic from the room |\n| method | [`topic(newTopic: string): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#Room+topic) | SET topic from the room |\n| method | [`announce(text: string): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#Room+announce) | SET/GET announce from the room |\n| method | [`qrcode(): Promise\u003cstring\u003e`](https://wechaty.github.io/wechaty/#Room+qrcode) | Get QR Code of the Room from the room, which can be used as scan and join the room. |\n| method | [`alias(contact: Contact): Promise\u003cstring\u003e`](https://wechaty.github.io/wechaty/#Room+alias) | Return contact's roomAlias in the room |\n| method | [`roomAlias(contact: Contact): Promise\u003cstring \\| null\u003e`](https://wechaty.github.io/wechaty/#Room+roomAlias) | Same as function alias |\n| method | [`has(contact: Contact): Promise\u003cboolean\u003e`](https://wechaty.github.io/wechaty/#Room+has) | Check if the room has member `contact` |\n| method | [`memberAll(query?: string): Promise\u003cContact[]\u003e`](https://wechaty.github.io/wechaty/#Room+memberAll) | Find all contacts or with specific name in a room |\n| method | [`member(query: string): Promise\u003cnull \\| Contact\u003e`](https://wechaty.github.io/wechaty/#Room+member) | Find all contacts in a room, if get many, return the first one. |\n| method | [`memberList():Promise\u003cContact[]\u003e`](https://wechaty.github.io/wechaty/#Room+memberList) | get all room member from the room |\n| method | [`owner(): null \\| Contact`](https://wechaty.github.io/wechaty/#Room+owner) | Get room's owner from the room. |\n\n#### 4.1 Class `RoomInvitation`\n\nAccept room invitation\n\n| RoomInvitation | API | Description |\n| :--- | :--- | :---        |\n| method | [`accept(): Promise\u003cvoid\u003e`](https://wechaty.github.io/wechaty/#RoomInvitation+accept) | accept Room Invitation |\n| method | [`inviter(): Contact`](https://wechaty.github.io/wechaty/#RoomInvitation+inviter) | get the inviter from room invitation |\n| method | [`roomTopic(): Promise\u003cstring\u003e`](https://wechaty.github.io/wechaty/#RoomInvitation+inviter) | get the room topic from room invitation |\n| method | [`date(): Promise\u003cDate\u003e`](https://wechaty.github.io/wechaty/#RoomInvitation+date) | the time it was created |\n| method | [`age(): Promise\u003cnumber\u003e`](https://wechaty.github.io/wechaty/#RoomInvitation+age) | the number of seconds since it has been created |\n\n## TEST\n\n[![NPM](https://github.com/wechaty/wechaty/workflows/NPM/badge.svg)](https://github.com/wechaty/wechaty/actions?query=workflow%3ANPM)\n[![Docker](https://github.com/wechaty/wechaty/workflows/Docker/badge.svg)](https://github.com/wechaty/wechaty/actions?query=workflow%3ADocker)\n[![Coverage Status](https://coveralls.io/repos/github/wechaty/wechaty/badge.svg?branch=main)](https://coveralls.io/github/wechaty/wechaty?branch=main)\n\n[![Known Vulnerabilities](https://snyk.io/test/github/Wechaty/wechaty/badge.svg)](https://snyk.io/test/github/Wechaty/wechaty)\n\nWechaty is fully automatically tested by unit and integration tests, with Continuous Integration \u0026 Continuous Delivery (CI/CD) support powered by CI like Travis, Shippable and Appveyor.\n\nTo test Wechaty, run:\n\n```shell\nnpm test\n```\n\nGet to know more about the tests from [Wiki:Tests](https://github.com/Wechaty/wechaty/wiki/Tests)\n\n## CREATING WECHATY PLUGIN\n\nCreating and publishing a Wechaty Plugin is simple. Simply expose your module as a function that takes 1 parameter: wechaty. When your plugin is imported by Wechaty, it will pass itself in as the argument, and so you are free to add any configuration that Wechaty supports.\n\n```ts\nimport { WechatyPlugin } from 'wechaty'\n\nexport default const MyPlugin: WechatyPlugin = (wechaty: Wechaty) =\u003e {\n  // ...\n}\n```\n\nThe `config` exist so the user can pass in customizations to your Plugin. In documenting your Wechaty Plugin, you would lay out your supported config for the user.\n\nSee:\n\n1. [Wechaty Plugin Support with KickOut Example #1939](https://github.com/wechaty/wechaty/issues/1939)\n1. [Wechaty Plugins Contrib](https://github.com/wechaty/wechaty-plugin-contrib)\n\n## :pencil: RELEASE NOTES\n\n- [Latest Release](https://github.com/Wechaty/wechaty/releases/latest)(All releases [here](https://github.com/Wechaty/wechaty/releases))\n- [Changelog](https://github.com/Wechaty/wechaty/blob/main/CHANGELOG.md)\n\n### :saxophone: Views Since Feb 15, 2019\n\n[![HitCount](http://hits.dwyl.io/wechaty/wechaty.svg)](http://hits.dwyl.io/wechaty/wechaty)\n\n## :sparkling_heart: POWERED BY WECHATY\n\n[![Powered by Wechaty](https://img.shields.io/badge/Powered%20By-Wechaty-brightgreen.svg)](https://wechaty.js.org)\n\n### :sparkles: Wechaty Badge\n\n```markdown\n[![Powered by Wechaty](https://img.shields.io/badge/Powered%20By-Wechaty-brightgreen.svg)](https://wechaty.js.org)\n```\n\nGet more embed html/markdown code from [Wiki:Badge](https://github.com/wechaty/wechaty/wiki/Badge)\n\n### :star2: Projects Using Wechaty\n\n1. [一个用CNN深度神经网络给图片评分的wechaty项目](https://github.com/huyingxi/wechaty_selfie)\n2. [Relay between Telegram and WeChat](https://github.com/Firaenix/TeleChatRelay)\n3. [A chat bot managing the HaoShiYou wechat groups run by volunteers of haoshiyou.org](https://github.com/xinbenlv/haoshiyou-bot)\n4. [An interactive chat bot to manage a TODO list](https://github.com/coderbunker/candobot)\n5. [Forward WeChat messages to telegram](https://github.com/luosheng/Wegram)\n6. [koa与wechaty实现的微信小助手，可定时提醒与发消息设定定时任务](https://github.com/gengchen528/wechat-assistant)\n7. [Wechaty Pay - 让线上没有难做的生意](https://github.com/coderwhocode/wechaty-pay)\n8. [开源社的微信机器人项目](https://github.com/kaiyuanshe/wechat-robot)\n\nPull Request is welcome to add yours!\n\nLearn more about Projects Using Wechaty at [Wiki:Projects Using Wechaty](https://github.com/wechaty/wechaty/wiki/Projects-Using-Wechaty)\n\n## :innocent: Find a Good Server\n\nThe best practice for running Wechaty Docker/NPM is using a VPS(Virtual Private Server) outside of China, which can save you hours of time because `npm install` and `docker pull` will run smoothly without any problem.\n\nThe following VPS providers are used by the Wechaty team, and they worked perfectly in production. You can use the following link to get one in minutes. Also, doing this can support Wechaty because you are referred by us.\n\n| Location  | Price | Ram     | Payment           | Provider |\n| ---       | ---   | ---     | ---               | ---      |\n| Singapore | $5    | 512MB   | Paypal            | [DigitalOcean](https://m.do.co/c/01a54778df5c) |\n| Japan     | $5    | 1GB     | Paypal            | [Linode](https://www.linode.com/?r=5fd2b713d711746bb5451111df0f2b6d863e9f63) |\n| Korea     | $10   | 1GB     | Alipay, Paypal    | [Netdedi](https://www.netdedi.com/?affid=35) |\n| Singapore | $3.5  | 512MB   | Alipay, Wechat    | [Vultr](https://www.vultr.com/?ref=6986613) |\n\n## :notes: See Also\n\n- [RelatedProject](https://github.com/Wechaty/wechaty/wiki/RelatedProject)\n\n## :poop: The Story\n\nIn 2017 ...\n\nHuan's daily life/work depends on too much chat on wechat.\n\n- Almost 14,000 wechat friends in May 2014, before wechat restricts a total number of friends to 5,000.\n- Almost 400 wechat rooms, and most of them have more than 400 members.\n\nCan you imagine that? He was dying...\n\nSo a tireless bot working for me 24x7 on wechat, monitoring/filtering the most important message is badly needed. For example, it highlights discussion which contains the KEYWORDS which he want to follow up(especially in a noisy room). ;-)\n\nAt last, It's built for huan's personal study purpose of Automatically Testing.\n\n## Stargazers over time\n\n[![Stargazers over time](https://starchart.cc/wechaty/wechaty.svg)](https://starchart.cc/wechaty/wechaty)\n\n## :two_hearts: Contributors\n\n[![GitHub issues](https://img.shields.io/github/issues/wechaty/wechaty.svg)](https://github.com/Wechaty/wechaty/issues)\n[![GitHub pull requests](https://img.shields.io/github/issues-pr/wechaty/wechaty.svg)](https://github.com/Wechaty/wechaty/pulls)\n[![Open Collective Backers](https://opencollective.com/wechaty/backer/badge.svg?label=open%20collective%20backers\u0026color=blue)](https://opencollective.com/wechaty/)\n[![Open Collective Sponsors](https://opencollective.com/wechaty/sponsors/badge.svg?label=open%20collective%20sponsors\u0026color=blue)](https://opencollective.com/wechaty/)\n\n[![contributor](https://sourcerer.io/fame/huan/wechaty/wechaty/images/0)](https://sourcerer.io/fame/huan/wechaty/wechaty/links/0)\n[![contributor](https://sourcerer.io/fame/huan/wechaty/wechaty/images/1)](https://sourcerer.io/fame/huan/wechaty/wechaty/links/1)\n[![contributor](https://sourcerer.io/fame/huan/wechaty/wechaty/images/2)](https://sourcerer.io/fame/huan/wechaty/wechaty/links/2)\n[![contributor](https://sourcerer.io/fame/huan/wechaty/wechaty/images/3)](https://sourcerer.io/fame/huan/wechaty/wechaty/links/3)\n[![contributor](https://sourcerer.io/fame/huan/wechaty/wechaty/images/4)](https://sourcerer.io/fame/huan/wechaty/wechaty/links/4)\n[![contributor](https://sourcerer.io/fame/huan/wechaty/wechaty/images/5)](https://sourcerer.io/fame/huan/wechaty/wechaty/links/5)\n[![contributor](https://sourcerer.io/fame/huan/wechaty/wechaty/images/6)](https://sourcerer.io/fame/huan/wechaty/wechaty/links/6)\n[![contributor](https://sourcerer.io/fame/huan/wechaty/wechaty/images/7)](https://sourcerer.io/fame/huan/wechaty/wechaty/links/7)\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\n-----\n\n[![Contribute](https://opencollective.com/wechaty/contributors.svg?width=890\u0026button=false)](https://github.com/Wechaty/wechaty/graphs/contributors)\n\n## :sunglasses: Backers\n\n[![Backers on Open Collective](https://opencollective.com/wechaty/backers/badge.svg)](#sunglasses-backers)\n\nThank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/wechaty#backer)]\n\n[![Open Collective Wechaty](https://opencollective.com/wechaty/backers.svg?width=890)](https://opencollective.com/wechaty#backers)\n\n## :smirk: Sponsors\n\n[![Sponsors on Open Collective](https://opencollective.com/wechaty/sponsors/badge.svg)](#smirk-sponsors)\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/wechaty#sponsor)]\n\n[![Wechaty Sponsor](https://opencollective.com/wechaty/sponsor.svg?width=890)](https://opencollective.com/wechaty/#sponsor)\n\n## Multi-language Wechaty\n\n[![Python Wechaty](https://img.shields.io/badge/Wechaty-Python-blue)](https://github.com/wechaty/python-wechaty)\n[![Go Wechaty](https://img.shields.io/badge/Wechaty-Go-7de)](https://github.com/wechaty/go-wechaty)\n[![Java(Kotlin) Wechaty](https://img.shields.io/badge/Wechaty-Java-f80)](https://github.com/wechaty/java-wechaty)\n[![Scala Wechaty](https://img.shields.io/badge/Wechaty-Scala-890)](https://github.com/wechaty/scala-wechaty)\n[![PHP Wechaty](https://img.shields.io/badge/Wechaty-PHP-99c)](https://github.com/wechaty/php-wechaty)\n[![.NET(C#) Wechatyin](https://img.shields.io/badge/Wechaty-.NET-629)](https://github.com/wechaty/dotnet-wechaty)\n\n- [Wechaty](https://github.com/wechaty/wechaty) - RPA SDK for Chatot Makers (TypeScript)\n- [Python Wechaty](https://github.com/wechaty/python-wechaty) - RPA SDK for Chatbot Makers written in Python\n- [Go Wechaty](https://github.com/wechaty/go-wechaty) - RPA SDK for Chatbot Makers written in Go\n- [Java Wechaty](https://github.com/wechaty/java-wechaty) - RPA SDK for Chatbot Makers written in Java(Kotlin)\n- [Scala Wechaty](https://github.com/wechaty/scala-wechaty) - RPA SDK for Chatbot Makers written in Scala\n- [PHP Wechaty](https://github.com/wechaty/php-wechaty) - RPA SDK for Chatbot Makers written in PHP\n- [.Net(C#) Wechaty](https://github.com/wechaty/dotnet-wechaty) - RPA SDK for Chatbot Makers written in .NET(C#)\n\n## History\n\n### main v1.11 (Nov 22, 2021)\n\nWorking on reduxify the Wechaty ecosystem for applying the CQRS pattern.\n\n### v1.10 (Nov 21, 2021)\n\nSecond beta release of Wechaty, with all ecosystem npm modules with version v1.10 (wechaty-puppet, wechaty-puppet-service, etc)\n\n### v1.0 (Sep 2021)\n\n- Release v1.0 of Wechaty is the first beta release of Wechaty.\n\n### v0.69\n\n1. v0.69: Supports ES Modules (with CJS dual support) ([#2232](https://github.com/wechaty/wechaty/issues/2232))\n\n### v0.68 (Aug 27, 2021)\n\n1. TLS support ([#2231](https://github.com/wechaty/wechaty/issues/2231))\n1. The latest CommonJS version\n\n## Creators\n\n1. [Huan](https://github.com/huan) [(LinkedIn)](http://linkedin.com/in/huan42), 🐧 Tencent TVP of Chatbot・🤖 Chatie Architect・⭐️ GitHub Star・🚀 YC W19・🌐 Microsoft RD \u0026 AI MVP・🦾 Google ML GDE ・🤠 Serial Entrepreneur・🔥 Burner\n1. [Rui (李佳芮)](https://pre-angel.com/peoples/jiarui-li/), Microsoft AI MVP \u0026 RD, Co-founder \u0026 CEO of [Juzi.BOT](https://www.juzibot.com/) (YC W19 Alumni)\n\n[![Profile of Huan Li on StackOverflow](https://stackoverflow.com/users/flair/1123955.png)](https://stackoverflow.com/users/1123955/huan)\n\n## Cite Wechaty\n\nTo cite this project in publications:\n\n```bibtex\n@misc{Wechaty,\n  author = {Huan Li, Rui Li},\n  title = {Wechaty: Conversational SDK for Chatbot Makers},\n  year = {2016},\n  publisher = {GitHub},\n  journal = {GitHub Repository},\n  howpublished = {\\url{https://github.com/wechaty/wechaty}},\n}\n```\n\n## Copyright \u0026 License\n\n- Code \u0026 Docs © 2016-now Huan, Rui, and Wechaty Community Contributors\n- Code released under the Apache-2.0 License\n- Docs released under Creative Commons\n","funding_links":["https://opencollective.com/wechaty","https://opencollective.com/wechaty/"],"categories":["TypeScript","HarmonyOS","Repository","Development","TypeScript (19)","目录","网络服务"],"sub_categories":["Windows Manager","Automation \u0026 RPA","Bot Development","网络服务_其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwechaty%2Fwechaty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwechaty%2Fwechaty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwechaty%2Fwechaty/lists"}