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)}>`, : `<t:${Math.floor(new Date(invite.expires_at).getTime() / 1000)}>`,
inline: true, inline: true,
}; };
const inviter = { const inviter = invite.inviter
name: "Inviter", ? {
value: `**${ name: "Inviter",
invite.inviter.discriminator && invite.inviter.discriminator != "0" value: `**${
? `${invite.inviter.username}#${invite.inviter.discriminator}` invite.inviter.discriminator && invite.inviter.discriminator != "0"
: `@${invite.inviter.username}` ? `${invite.inviter.username}#${invite.inviter.discriminator}`
}** (${invite.inviter.id})`, : `@${invite.inviter.username}`
inline: false, }** (${invite.inviter.id})`,
}; inline: false,
}
: null;
if (invite.type == 0) { if (invite.type == 0) {
embed.fields.push( embed.fields.push(