Skip to content

Commit

Permalink
fix(v13-changes): typingStart examples (discordjs#915)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite authored Oct 18, 2021
1 parent 053a1ee commit 5267358
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions guide/additional-info/changes-in-v13.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ To generate an invite link for a bot and define required permissions:
Previously when a token had reached its 1000 login limit for the day, discord.js would treat this as a rate limit and silently wait to login again, but this was not communicated to the user.
This will now instead cause an error to be thrown.

#### Client#typingStart

The `Client#typingStart` event now only emits a `Typing` structure. Previously, `Channel` and `User` were emitted.

#### Client#setInterval
#### Client#setTimeout

Expand Down Expand Up @@ -1342,6 +1346,10 @@ Represent a member of a thread and their thread-specific metadata.

Provides API support for the bot to add and remove members from threads, and stores a cache of `ThreadMembers`.

### Typing

Represents a typing state for a user in a channel.

### Webhook

#### Webhook#deleteMessage
Expand Down
6 changes: 3 additions & 3 deletions guide/additional-info/es6-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ client.once('ready', function() {
console.log('Ready!');
});

client.on('typingStart', function(channel, user) {
console.log(user + ' started typing in ' + channel);
client.on('typingStart', function(typing) {
console.log(typing.user + ' started typing in ' + typing.channel);
});

client.on('messageCreate', function(message) {
Expand All @@ -163,7 +163,7 @@ var collector = message.createMessageCollector({ filter, time: 15000 });
// arrow functions, full ES6
client.once('ready', () => console.log('Ready!'));

client.on('typingStart', (channel, user) => console.log(`${user} started typing in ${channel}`));
client.on('typingStart', typing => console.log(`${typing.user} started typing in ${typing.channel}`));

client.on('messageCreate', message => console.log(`${message.author} sent: ${message.content}`));

Expand Down

0 comments on commit 5267358

Please sign in to comment.