Skip to content

Commit

Permalink
✨ TWEAK: remove extra logs
Browse files Browse the repository at this point in the history
  • Loading branch information
warengonzaga authored May 4, 2023
1 parent 99782e8 commit ed0b00d
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ const {
ChannelType,
GatewayIntentBits,
Partials,
EmbedBuilder,
Embed } = require('discord.js');
EmbedBuilder } = require('discord.js');
const { GoogleSpreadsheet } = require('google-spreadsheet');
const config = require(`${__dirname}/config.json`);
const moment = require('moment');
Expand Down Expand Up @@ -100,12 +99,11 @@ client.on('messageCreate', async (message) => {
// check if the command has the prefix and includes "close"
if (message.content.startsWith(config.command_prefix) && message.content.includes(config.command_resolve)) {
await message.delete(); // delete the commmand message
// check if the channel is a thread and the user has support role
console.log(`[log]: ${message.channel.type} (${ChannelType.PublicThread})`);

// check if the message is in the forum post and from the support role
if (message.channel.type === ChannelType.PublicThread && member.roles.cache.hasAny(...roleIDs)) {
console.log(`[log]: command sender has proper roles`);
console.log(`[log]: post tags: ${postTags.length}`);

// check if the post has fewer tags
if (postTags.length < 5) {

// send embed message before closing the post
Expand Down Expand Up @@ -152,11 +150,7 @@ client.on('messageCreate', async (message) => {
})
.then(message => {
setTimeout(() => message.delete(), 10000) // delete message after 15s
console.log(`[log]: ${config.reminder_max_tags}`);
})
.catch(
console.log(`[log]: failed to send embed message to ${message.author.username}`)
);
});
}
}
}
Expand Down

0 comments on commit ed0b00d

Please sign in to comment.