utility.lookupinvite: fix some formatting

This commit is contained in:
Cynthia Foxwell 2024-07-31 21:13:46 -06:00
parent cde9d119e0
commit 3e84bdb299

View file

@ -69,7 +69,11 @@ lookupinvite.callback = async function (msg, line) {
const inviter = invite.inviter
? {
name: "Inviter",
value: `**${formatUsername(invite.inviter)}** (${invite.inviter.id})`,
value: `${
invite.inviter.global_name
? `**${invite.inviter.global_name}** (${formatUsername(invite.inviter)})`
: `**${formatUsername(invite.inviter)}**`
} \`(${invite.inviter.id})\``,
inline: false,
}
: null;
@ -80,12 +84,12 @@ lookupinvite.callback = async function (msg, line) {
...[
{
name: "Guild",
value: `**${invite.guild.name}** (${invite.guild.id})`,
value: `**${invite.guild.name}** \`(${invite.guild.id})\``,
inline: true,
},
{
name: "Channel",
value: `**${invite.channel.name}** (${invite.channel.id})`,
value: `**${invite.channel.name}** \`(${invite.channel.id})\``,
inline: true,
},
{
@ -96,7 +100,7 @@ lookupinvite.callback = async function (msg, line) {
expires,
{
name: "Member Count",
value: `${Icons.online}${invite.approximate_presence_count} online${Icons.blank}${Icons.blank}${Icons.offline}${invite.approximate_member_count} members`,
value: `${Icons.online}${invite.approximate_presence_count} online\u3000\u3000${Icons.offline}${invite.approximate_member_count} members`,
inline: false,
},
inviter,
@ -181,7 +185,13 @@ lookupinvite.callback = async function (msg, line) {
expires,
invite.channel.name != null && {
name: "Recipients",
value: invite.channel.recipients.map((member) => member.username).join(", "),
value: invite.channel.recipients
.map((member) =>
member.global_name
? `**${member.global_name}** (${formatUsername(member)})`
: `**${formatUsername(member)}**`
)
.join("\n"),
inline: false,
},
inviter,