Skip to content

Commit

Permalink
chore: revert to discord.js 14.14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
GodderE2D committed Jul 3, 2024
1 parent b945d69 commit 856905b
Show file tree
Hide file tree
Showing 3 changed files with 570 additions and 655 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@sapphire/utilities": "^3.16.2",
"@sentry/node": "^7.116.0",
"dayjs": "^1.11.11",
"discord.js": "^14.15.3",
"discord.js": "14.14.1",
"dotenv": "^16.4.5",
"fastify": "^4.27.0",
"ms": "^2.1.3",
Expand Down
24 changes: 12 additions & 12 deletions src/functions/report/selectGuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,29 +146,29 @@ export async function selectGuild(
const guild = interaction.client.guilds.cache.get(guildId);

if (!guild) {
return await modalInteraction.reply({
return void (await modalInteraction.reply({
content:
"The server ID you provided was invalid, the server wasn't found, the target isn't in the server, the server hasn't set up Reindeer yet, or the server disabled reports from DMs. Please try again.",
ephemeral: true,
});
}));
}

const guildData = await prisma.guild.findUnique({ where: { guildId: guild.id } });

if (!guildData?.dmReportsEnabled) {
return await modalInteraction.reply({
return void (await modalInteraction.reply({
content:
"The server ID you provided was invalid, that server wasn't found, the target isn't in the server, the server hasn't set up Reindeer yet, or the server disabled reports from DMs. Please try again.",
ephemeral: true,
});
}));
}

if (!(await guild?.members.fetch(target.id).catch(() => undefined))) {
return await modalInteraction.reply({
return void (await modalInteraction.reply({
content:
"The server ID you provided was invalid, that server wasn't found, the target isn't in the server, the server hasn't set up Reindeer yet, or the server disabled reports from DMs. Please try again.",
ephemeral: true,
});
}));
}

await modalInteraction.deferUpdate();
Expand All @@ -185,29 +185,29 @@ export async function selectGuild(
const guild = interaction.client.guilds.cache.get(guildId);

if (!guild) {
return await i.reply({
return void (await i.reply({
content:
"The server you selected was invalid, that server wasn't found, the target isn't in the server, the server hasn't set up Reindeer yet, or the server disabled reports from DMs. Please try again.",
ephemeral: true,
});
}));
}

const guildData = await prisma.guild.findUnique({ where: { guildId: guild.id } });

if (!guildData?.dmReportsEnabled) {
return await i.reply({
return void (await i.reply({
content:
"The server you selected was invalid, that server wasn't found, the target isn't in the server, the server hasn't set up Reindeer yet, or the server disabled reports from DMs. Please try again.",
ephemeral: true,
});
}));
}

if (!(await guild?.members.fetch(target.id))) {
return await i.reply({
return void (await i.reply({
content:
"The server ID you provided was invalid, that server wasn't found, the target isn't in the server, the server hasn't set up Reindeer yet, or the server disabled reports from DMs. Please try again.",
ephemeral: true,
});
}));
}

await i.update({ embeds: [generateConfirmEmbed(guild)], components: [menuRow, createButtonRow(true)] });
Expand Down
Loading

0 comments on commit 856905b

Please sign in to comment.