Skip to content

Commit

Permalink
client destruction and await send
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealDax committed Aug 10, 2023
1 parent 8408273 commit c7484d6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions endpoints/vcrecord.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,14 @@ const vcRecord = async (req, res) => {
}

if (fileSizeInMegabytes > premiumLimit) {
recordingChannel.send(`Your recording could not be sent. Your server has a file upload limit of ${premiumLimit}MB and your recording is ${fileSizeInMegabytes.toFixed(2)}MB.`);
return;
await recordingChannel.send(`Your recording could not be sent. Your server has a file upload limit of ${premiumLimit}MB and your recording is ${fileSizeInMegabytes.toFixed(2)}MB.`);
client.destroy();
} else {
const attachment = new AttachmentBuilder(mp3File, { name: `${recordingname}.mp3` });
recordingChannel.send({
await recordingChannel.send({
files: [attachment],
});
client.destroy();
}
} catch (error) {
console.log(error);
Expand Down

0 comments on commit c7484d6

Please sign in to comment.