Skip to content

Commit e5fcf1f

Browse files
Swap out deprecated bot.chatAddPattern() in tutorial.md (#3709)
swapped out deprecated chatAddPattern()
1 parent 464000a commit e5fcf1f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docs/tutorial.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,8 @@ In general, you'll want to use `for of` instead of `for in` so make sure you don
557557
558558
### Creating an event from chat
559559
560-
You can create your own event from chat using [`bot.chatAddPattern()`](http://prismarinejs.github.io/mineflayer/#/api?id=botchataddpatternpattern-chattype-description) method. Useful for Bukkit servers where the chat format changes a lot.
561-
[`bot.chatAddPattern()`](http://prismarinejs.github.io/mineflayer/#/api?id=botchataddpatternpattern-chattype-description) method takes three arguments :
560+
You can create your own event from chat using [`bot.addChatPattern()`](http://prismarinejs.github.io/mineflayer/#/api?id=botaddchatpatternname-pattern-chatpatternoptions) method. Useful for Bukkit servers where the chat format changes a lot.
561+
[`bot.addChatPattern()`](http://prismarinejs.github.io/mineflayer/#/api?id=botaddchatpatternname-pattern-chatpatternoptions) method takes three arguments :
562562
563563
- `pattern` - regular expression (regex) to match chat
564564
- `chatType` - the event the bot emits when the pattern matches. e.g. "chat" or "whisper"
@@ -575,7 +575,7 @@ Examples :
575575
Here we're creating a bot that answer 'hello' from the other player.
576576
577577
```js
578-
bot.chatAddPattern(
578+
bot.addChatPattern(
579579
/(helo|hello|Hello)/,
580580
'hello',
581581
'Someone says hello'
@@ -601,7 +601,7 @@ Custom chat example:
601601
```
602602
603603
```js
604-
bot.chatAddPattern(
604+
bot.addChatPattern(
605605
/^\[(.+)\] (\S+) > (.+)$/,
606606
'my_chat_event',
607607
'Custom chat event'

0 commit comments

Comments
 (0)