utility.lookupinvite: add recipients field if gdm has name

This commit is contained in:
Cynthia Foxwell 2023-05-29 20:33:52 -06:00
parent 778f5aeab1
commit 7a89753875

View file

@ -565,23 +565,32 @@ lookupinvite.callback = async function (msg, line) {
} else if (invite.type == 1) {
embed.title += " (Group DM)";
embed.fields.push(
{
name: "Channel",
value: `**${
invite.channel.name ??
invite.channel.recipients
...[
{
name: "Channel",
value: `**${
invite.channel.name ??
invite.channel.recipients
.map((member) => member.username)
.join(", ")
}** (${invite.channel.id})`,
inline: false,
},
{
name: "Member Count",
value: `${STATUS_ICONS.offline}${invite.approximate_member_count} members`,
inline: true,
},
invite.channel.name == null && {
name: "Recipients",
value: invite.channel.recipients
.map((member) => member.username)
.join(", ")
}** (${invite.channel.id})`,
inline: false,
},
{
name: "Member Count",
value: `${STATUS_ICONS.offline}${invite.approximate_member_count} members`,
inline: true,
},
expires,
inviter
.join(", "),
inline: false,
},
expires,
inviter,
].filter((x) => !!x)
);
const groupIcon = invite.channel.icon