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,7 +442,8 @@ 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", name: "Inviter",
value: `**${ value: `**${
invite.inviter.discriminator && invite.inviter.discriminator != "0" invite.inviter.discriminator && invite.inviter.discriminator != "0"
@ -450,7 +451,8 @@ lookupinvite.callback = async function (msg, line) {
: `@${invite.inviter.username}` : `@${invite.inviter.username}`
}** (${invite.inviter.id})`, }** (${invite.inviter.id})`,
inline: false, inline: false,
}; }
: null;
if (invite.type == 0) { if (invite.type == 0) {
embed.fields.push( embed.fields.push(