3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

feat: new username support

This commit is contained in:
Dragory 2023-06-24 10:41:02 +00:00
parent 514e93aa23
commit 0e70412bc4
8 changed files with 42 additions and 20 deletions

View file

@ -7,6 +7,7 @@ import {
EmbedWith,
messageLink,
preEmbedPadding,
renderUsername,
resolveMember,
resolveUser,
sorter,
@ -43,7 +44,7 @@ export async function getUserInfoEmbed(
const timeAndDate = pluginData.getPlugin(TimeAndDatePlugin);
embed.author = {
name: `${user.bot ? "Bot" : "User"}: ${user.tag}`,
name: `${user.bot ? "Bot" : "User"}: ${renderUsername(user.username, user.discriminator)}`,
};
const avatarURL = user.displayAvatarURL();
@ -89,14 +90,16 @@ export async function getUserInfoEmbed(
return embed;
}
const userInfoLines = [`ID: \`${user.id}\``, `Username: **${user.username}**`];
if (user.discriminator !== "0") {
userInfoLines.push(`Discriminator: **${user.discriminator}**`);
}
userInfoLines.push(`Created: **${accountAge} ago** (\`${prettyCreatedAt}\`)`);
userInfoLines.push(`Mention: <@!${user.id}>`);
embed.fields.push({
name: preEmbedPadding + `${user.bot ? "Bot" : "User"} information`,
value: trimLines(`
Name: **${user.tag}**
ID: \`${user.id}\`
Created: **${accountAge} ago** (\`${prettyCreatedAt}\`)
Mention: <@!${user.id}>
`),
value: userInfoLines.join("\n"),
});
if (member) {