utiltiy.lookupinvite: fix null inviter erroring

This commit is contained in:
Cynthia Foxwell 2023-06-07 10:25:55 -06:00
parent d697268746
commit a8f59ea6ac

View file

@ -442,15 +442,17 @@ lookupinvite.callback = async function (msg, line) {
: `<t:${Math.floor(new Date(invite.expires_at).getTime() / 1000)}>`,
inline: true,
};
const inviter = {
name: "Inviter",
value: `**${
invite.inviter.discriminator && invite.inviter.discriminator != "0"
? `${invite.inviter.username}#${invite.inviter.discriminator}`
: `@${invite.inviter.username}`
}** (${invite.inviter.id})`,
inline: false,
};
const inviter = invite.inviter
? {
name: "Inviter",
value: `**${
invite.inviter.discriminator && invite.inviter.discriminator != "0"
? `${invite.inviter.username}#${invite.inviter.discriminator}`
: `@${invite.inviter.username}`
}** (${invite.inviter.id})`,
inline: false,
}
: null;
if (invite.type == 0) {
embed.fields.push(