From 187f2d5a7fca835ca24558735035e8c9fb5351e1 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Sun, 9 Oct 2022 12:34:36 -0600 Subject: [PATCH] use User.tag --- src/lib/utils.js | 4 +--- src/modules/misc.js | 4 ++-- src/modules/music.js | 4 +--- src/modules/utility.js | 18 +++++++++--------- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/lib/utils.js b/src/lib/utils.js index 0cea28e..80a0259 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -310,9 +310,7 @@ async function lookupUser(msg, str, filter) { selection.push({ value: user, key: user.id, - display: `${user.username}#${user.discriminator}${ - user.nick ? ` (${user.nick})` : "" - }`, + display: `${user.tag}${user.nick ? ` (${user.nick})` : ""}`, }); } } diff --git a/src/modules/misc.js b/src/modules/misc.js index dd4d213..6c48b20 100644 --- a/src/modules/misc.js +++ b/src/modules/misc.js @@ -233,7 +233,7 @@ poll.callback = async function (msg, line, topic, ...options) { if (arrOptions.length < 2) return "A minimum of two options are required."; const reactions = []; - let displayString = `**${msg.author.username}#${msg.author.discriminator}** has started a poll:\n**__${topic}__**\n`; + let displayString = `**${msg.author.tag}** has started a poll:\n**__${topic}__**\n`; for (let i = 0; i < arrOptions.length; i++) { displayString += (i === 9 ? "\ud83d\udd1f" : `${i + 1}\u20e3`) + @@ -258,7 +258,7 @@ vote.callback = async function (msg, line) { if (!line) return "No topic given."; return { - content: `**${msg.author.username}#${msg.author.discriminator}** has started a vote:\n**__${line}__**\n<:ms_tick:503341995348066313>: Yes\n<:ms_cross:503341994974773250>: No`, + content: `**${msg.author.tag}** has started a vote:\n**__${line}__**\n<:ms_tick:503341995348066313>: Yes\n<:ms_cross:503341994974773250>: No`, addReactions: [ ":ms_tick:503341995348066313", ":ms_cross:503341994974773250", diff --git a/src/modules/music.js b/src/modules/music.js index b6fe33b..c47e022 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -758,9 +758,7 @@ command.callback = async function (msg, line) { return { key: item.id, display: (item.title ?? item.url).substr(0, 100), - description: hasManageMessages - ? `Added by: ${user.username}#${user.discriminator}` - : "", + description: hasManageMessages ? `Added by: ${user.tag}` : "", }; }), 30000, diff --git a/src/modules/utility.js b/src/modules/utility.js index 963626b..5ace1fb 100644 --- a/src/modules/utility.js +++ b/src/modules/utility.js @@ -110,7 +110,7 @@ avatar.callback = async function (msg, line) { } const baseEmbed = { - title: `Avatar for \`${member.username}#${member.discriminator}\``, + title: `Avatar for \`${member.tag}\``, }; const normalAvatar = member.user.avatar; @@ -155,7 +155,7 @@ avatar.callback = async function (msg, line) { const guild = msg.channel.guild || hf.bot.guilds.get(msg.guildID); const baseEmbed = { - title: `Avatar for \`${msg.author.username}#${msg.author.discriminator}\``, + title: `Avatar for \`${msg.author.tag}\``, }; const normalAvatar = msg.author.avatar; @@ -255,7 +255,7 @@ banner.callback = async function (msg, line) { return { embeds: [ { - title: `Banner for \`${user.username}#${user.discriminator}\``, + title: `Banner for \`${user.tag}\``, url, image: { url, @@ -505,16 +505,16 @@ flagdump.callback = async function (msg, line) { if (!user) { return "User not cached."; } else { - return `\`${user.username}#${ - user.discriminator - }\`'s public flags:\n\`\`\`${flagFromInt(user.publicFlags)}\`\`\``; + return `\`${user.tag}\`'s public flags:\n\`\`\`${flagFromInt( + user.publicFlags + )}\`\`\``; } } else if (!isNaN(num)) { return `\`\`\`\n${flagFromInt(num)}\`\`\``; } else { - return `\`${msg.author.username}#${ - msg.author.discriminator - }\`'s public flags:\n\`\`\`${flagFromInt(msg.author.publicFlags)}\`\`\``; + return `\`${msg.author.tag}\`'s public flags:\n\`\`\`${flagFromInt( + msg.author.publicFlags + )}\`\`\``; } }; hf.registerCommand(flagdump);