Formatting fixes

This commit is contained in:
ExtrasContainer
2024-02-04 09:21:20 +00:00
parent effb72940d
commit b73fff2d24
+5 -11
View File
@@ -10,10 +10,10 @@ module.exports = {
const guildId = interaction.guild.id;
async function generateCaptcha(count) {
var upchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var lowchars = "abcdefghijklmnopqrstuvwxyz";
var nums = "0123456789";
//get a random letter/number from upchars, lowchars, and nums
var chars = upchars + lowchars + nums;
var captcha = "";
@@ -64,9 +64,6 @@ module.exports = {
return;
}
const buff = await createCaptcha(captcha);
const attachment = new AttachmentBuilder(buff, { name: 'captcha.png' });
@@ -90,7 +87,6 @@ module.exports = {
});
collector.on('collect', async (m) => {
//if member left the server before the verification is done
if (!interaction.guild.members.cache.has(interaction.user.id)) {
await interaction.user.send(cfg.messages.userLeft);
@@ -109,9 +105,8 @@ module.exports = {
}
}
});
collector.on('end', async (collected, reason) => {
collector.on('end', async (collected, reason) => {
if (reason === 'time' && !validated) { // Send timeout message only if not already validated
await interaction.user.send(cfg.messages.tookTooLong);
} else if (!validated) {
@@ -121,8 +116,7 @@ module.exports = {
}
});
})
.catch(async (err) => {
}).catch(async (err) => {
await interaction.reply({
content: cfg.messages.unableToDM,
ephemeral: true
@@ -142,4 +136,4 @@ Canvas is driving me nuts due to how hard to work with it.
Had to StackOverFlow-ed it to get it to work.
I'm not sure if this is the best way to do it but it works.
Big shoutout to StackOverFlow and the people I got the code from.
*/
*/