Skip to content

Commit

Permalink
docs: update username system references
Browse files Browse the repository at this point in the history
  • Loading branch information
uhKevinMC committed Jul 10, 2023
1 parent 09b0382 commit 99bb3b5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const client = new Client({ intents: [GatewayIntentBits.Guilds] });
// When the client is ready, run this code (only once)
// We use 'c' for the event parameter to keep it separate from the already defined 'client'
client.once(Events.ClientReady, (c) => {
console.log(`Ready! Logged in as ${c.user.tag}`);
console.log(`Ready! Logged in as ${c.user.username}`);
});

// Log in to Discord with your client's token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ for (const folder of commandFolders) {
```js ClientReady
client.once(Events.ClientReady, (c) => {
console.log(`Ready! Logged in as ${c.user.tag}`);
console.log(`Ready! Logged in as ${c.user.username}`);
});
```
Expand Down Expand Up @@ -145,7 +145,7 @@ export const data = {
once = true,
};
export async function execute(client) {
console.log(`Ready! Logged in as ${client.user.tag}`);
console.log(`Ready! Logged in as ${client.user.username}`);
}
```
Expand Down
8 changes: 4 additions & 4 deletions apps/guide/src/content/04-popular-topics/02-audit-logs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ client.on(Events.GuildAuditLogEntryCreate, async (auditLog) => {
const target = await client.users.fetch(targetId);

// Log the output.
console.log(`A message by ${target.tag} was deleted by ${executor.tag} in ${channel}.`);
console.log(`A message by ${target.username} was deleted by ${executor.username} in ${channel}.`);
});
```

Expand All @@ -104,7 +104,7 @@ client.on(Events.GuildAuditLogEntryCreate, async (auditLog) => {
const target = await client.users.fetch(targetId!);

// Log the output.
console.log(`A message by ${target.tag} was deleted by ${executor.tag} in ${channel}.`);
console.log(`A message by ${target.username} was deleted by ${executor.username} in ${channel}.`);
});
```

Expand Down Expand Up @@ -135,7 +135,7 @@ client.on(Events.GuildAuditLogEntryCreate, async (auditLog) => {
const kickedUser = await client.users.fetch(targetId);

// Now you can log the output!
console.log(`${kickedUser.tag} was kicked by ${executor.tag}.`);
console.log(`${kickedUser.username} was kicked by ${executor.username}.`);
});
```

Expand All @@ -156,7 +156,7 @@ client.on(Events.GuildAuditLogEntryCreate, async (auditLog) => {
const kickedUser = await client.users.fetch(targetId!);

// Now you can log the output!
console.log(`${kickedUser.tag} was kicked by ${executor.tag}.`);
console.log(`${kickedUser.username} was kicked by ${executor.username}.`);
});
```

Expand Down
2 changes: 1 addition & 1 deletion apps/guide/src/content/04-popular-topics/03-collectors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const collectorFilter = (reaction, user) => {
const collector = message.createReactionCollector({ filter: collectorFilter, time: 15_000 });

collector.on('collect', (reaction, user) => {
console.log(`Collected ${reaction.emoji.name} from ${user.tag}`);
console.log(`Collected ${reaction.emoji.name} from ${user.username}`);
});

collector.on('end', (collected) => {
Expand Down
6 changes: 3 additions & 3 deletions apps/guide/src/content/05-additional-info/02-collections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Many of the methods on _`Collection`_ correspond to their namesake in _`Array`_.

```js
// Assume we have an array of users and a collection of the same users.
array.find((u) => u.discriminator === '1000');
collection.find((u) => u.discriminator === '1000');
array.find((user) => user.bot === true);
collection.find((user) => user.bot === true);
```

</CH.Code>
Expand Down Expand Up @@ -100,7 +100,7 @@ collection.last(2);

// Removes anything that meets the condition from the collection.
// Sort of like `filter`, but in-place.
collection.sweep((user) => user.username === 'Bob');
collection.sweep((user) => user.displayName === 'Bob');
```

</CH.Code>
Expand Down

0 comments on commit 99bb3b5

Please sign in to comment.