Skip to content

Commit

Permalink
Fix the docs to use WechatyBuilder to instantiate the Wechaty instance (
Browse files Browse the repository at this point in the history
#1532)

* fix: use WechatyBuilder to instantiate the Wechaty instance

* Update docusaurus/docs/getting-started/running-locally.mdx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: use template literals for constructing URLs for better readability

* fix: update error handling message for the bot's start process

* revert: keep the QR code image URL part unchanged

* 0.11.8

* revert: keep project version unchanged

* 0.11.8

* 0.11.9

* revert: keep project version unchanged

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
Leo Zeng and coderabbitai[bot] committed Mar 15, 2024
1 parent 87f96e9 commit c97fbc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docusaurus/docs/getting-started/running-locally.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ import {
Contact,
Message,
ScanStatus,
Wechaty,
WechatyBuilder,
log,
}from 'wechaty'

Expand Down Expand Up @@ -364,8 +364,8 @@ async function onMessage (msg: Message) {
Now initializing the bot by providing a name.

```ts
const bot = new Wechaty({
name: 'ding-dong-bot',
const bot = WechatyBuilder.build({
name: 'ding-dong-bot'
})
```

Expand All @@ -383,7 +383,7 @@ Finally for starting the bot
```ts
bot.start()
.then(() => log.info('StarterBot', 'Starter Bot Started.'))
.catch(e => log.error('StarterBot', e))
.catch(e => log.error('StarterBot', 'Failed to start the bot:', e))
```

## Running the bot
Expand Down

0 comments on commit c97fbc0

Please sign in to comment.