From 99bb3b577f48493d6489fdc66e34fbd6e061d9ab Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 14 Jun 2023 20:29:44 -0500 Subject: [PATCH] docs: update username system references --- .../03-creating-your-bot/02-creating-the-main-file.mdx | 2 +- .../content/03-creating-your-bot/06-event-handling.mdx | 4 ++-- .../guide/src/content/04-popular-topics/02-audit-logs.mdx | 8 ++++---- .../guide/src/content/04-popular-topics/03-collectors.mdx | 2 +- .../src/content/05-additional-info/02-collections.mdx | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/guide/src/content/03-creating-your-bot/02-creating-the-main-file.mdx b/apps/guide/src/content/03-creating-your-bot/02-creating-the-main-file.mdx index 3942fa3d4d4a..4ca61135703d 100644 --- a/apps/guide/src/content/03-creating-your-bot/02-creating-the-main-file.mdx +++ b/apps/guide/src/content/03-creating-your-bot/02-creating-the-main-file.mdx @@ -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 diff --git a/apps/guide/src/content/03-creating-your-bot/06-event-handling.mdx b/apps/guide/src/content/03-creating-your-bot/06-event-handling.mdx index 935319d1211a..3021059fa467 100644 --- a/apps/guide/src/content/03-creating-your-bot/06-event-handling.mdx +++ b/apps/guide/src/content/03-creating-your-bot/06-event-handling.mdx @@ -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}`); }); ``` @@ -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}`); } ``` diff --git a/apps/guide/src/content/04-popular-topics/02-audit-logs.mdx b/apps/guide/src/content/04-popular-topics/02-audit-logs.mdx index 44f4e9c644c4..14882f072902 100644 --- a/apps/guide/src/content/04-popular-topics/02-audit-logs.mdx +++ b/apps/guide/src/content/04-popular-topics/02-audit-logs.mdx @@ -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}.`); }); ``` @@ -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}.`); }); ``` @@ -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}.`); }); ``` @@ -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}.`); }); ``` diff --git a/apps/guide/src/content/04-popular-topics/03-collectors.mdx b/apps/guide/src/content/04-popular-topics/03-collectors.mdx index 598d1bb60f5f..d763213b01d2 100644 --- a/apps/guide/src/content/04-popular-topics/03-collectors.mdx +++ b/apps/guide/src/content/04-popular-topics/03-collectors.mdx @@ -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) => { diff --git a/apps/guide/src/content/05-additional-info/02-collections.mdx b/apps/guide/src/content/05-additional-info/02-collections.mdx index c86cd16dc82d..6d122f1d1868 100644 --- a/apps/guide/src/content/05-additional-info/02-collections.mdx +++ b/apps/guide/src/content/05-additional-info/02-collections.mdx @@ -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); ``` @@ -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'); ```