Skip to content
Huan (李卓桓) edited this page Apr 5, 2022 · 14 revisions

From v0.x to v1.x

This Wiki page is for Wechaty developers who are familiar with the v0.x version and want to upgrade their code to v1.x.

We list all changes below (still under construction), and want to make it easy and clear to all developers for the migrating steps, and help everyone enjoy the newly v1.x with the least trouble.

Wechaty v1.x Example

The Friday BOT is the bot that is serving the Wechaty community for the past years.

It is based on the latest Wechaty v1.x version, running online, and works like a charm.

Here's its source code repo on GitHub at http://github.com/wechaty/friday, and you can visit its running dashboard at http://friday.chatie.io:5200/

Wechaty became an Interface

- import { Wechaty } from 'wechaty'
+ import { WechatyBuilder } From 'wechaty'

- const wechaty1 = new Wechaty()
+ const wechatyt1 = WechatyBuilder.build()
// or
- const wechaty2 = Wechaty.instance()
+ const wechaty2 = WechatyBuilder.singleton()

UrlLink can not be used without a wechaty instance

@atorber: 最需要改进的不是代码,而是文档,接口文档还是0.x,比如发送UrlLink怎么构建,摸索了两个小时才搞定...

So and MiniProgram, Location, and all other Wechaty User Modules (WUM)s.

- const urlLink = UrlLink.create('https://github.com')
+ const urlLink = wechaty.UrlLink.create('https://github.com')

To Be Added ...

Contributions are welcome!

Clone this wiki locally