Skip to content

Commit

Permalink
fallback if member quit guild
Browse files Browse the repository at this point in the history
  • Loading branch information
greg6775 committed Oct 22, 2023
1 parent d26c12c commit 6d6decf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export async function handleInteraction(interaction: Interaction) {
topic: `ticket of ${interaction.user.tag}`,
parent: "1081347349462405221",
});

const fields = [
{
name: `Reason:`,
Expand Down Expand Up @@ -174,7 +174,7 @@ export async function handleInteraction(interaction: Interaction) {
content: `> Successfully created your ticket here: ${ch}`,
ephemeral: true,
});

} catch (e) {
console.error(e);
}
Expand Down Expand Up @@ -392,7 +392,7 @@ export async function handleInteraction(interaction: Interaction) {
}
let out = "Owner - CPU, RAM, Storage, Slots, Invitecode, last invite, uses\n";
const partners = await getPartners();
out += (await Promise.all(partners.map(async (partner: any) => `<@${(await interaction.guild?.members.fetch(await getMemberFromBBNId(partner.owner)))?.user.id}> (${partner.owner}) - ${partner.cpu}, ${partner.memory}, ${partner.disk}, ${partner.slots}, ${partner.invite}, <t:${Math.round(partner.lastinvite / 1000)}:R>, ${(await interaction.guild?.invites.fetch(partner.invite))?.uses}`))).join("\n");
out += (await Promise.all(partners.map(async (partner: any) => `<@${(await interaction.guild?.members.fetch(await getMemberFromBBNId(partner.owner))) ? (await interaction.guild?.members.fetch(await getMemberFromBBNId(partner.owner)))!.user.id : "USER QUIT"}> (${partner.owner}) - ${partner.cpu}, ${partner.memory}, ${partner.disk}, ${partner.slots}, ${partner.invite}, <t:${Math.round(partner.lastinvite / 1000)}:R>, ${(await interaction.guild?.invites.fetch(partner.invite))?.uses}`))).join("\n");
interaction.reply(out);
}
}
Expand Down

0 comments on commit 6d6decf

Please sign in to comment.