Skip to content

Commit

Permalink
fix(ES6): use human readable properties in examples (discordjs#925)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite authored Oct 20, 2021
1 parent 549fbdf commit db39710
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions guide/additional-info/es6-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ client.once('ready', function() {
});

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

client.on('messageCreate', function(message) {
console.log(message.author + ' sent: ' + message.content);
console.log(message.author.tag + ' sent: ' + message.content);
});

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

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

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

const doubleAge = age => `Your age doubled is: ${age * 2}`;

Expand Down

0 comments on commit db39710

Please sign in to comment.