Skip to content

Commit

Permalink
handle fetch errors better
Browse files Browse the repository at this point in the history
  • Loading branch information
artifishvr committed May 19, 2024
1 parent 4162b2d commit d0866bc
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/commands/forget.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,20 @@ export default {
extension: "md",
}),
},
)
).catch((e) => {
console.error("Error uploading logs to wastebin: " + e);
return false;
});

const button = new ButtonBuilder()
.setLabel('View memories')
.setURL(`${process.env.WASTEBIN_HOST}${(await request.json()).path}`)
.setLabel('View cleared memories')
.setURL(request !== false ? `${process.env.WASTEBIN_HOST}${(await request.json()).path}` : 'https://blahaj.ca/')
.setStyle(ButtonStyle.Link);

await interaction?.editReply({
content: `${toSay}`,
failIfNotExists: true,
components: [new ActionRowBuilder().addComponents(button)],
components: request !== false ? [new ActionRowBuilder().addComponents(button)] : [],
});

return;
Expand Down

0 comments on commit d0866bc

Please sign in to comment.