Consider user already opted out when they run /optout to avoid logging them

Slash-V14
Supositware 2 months ago
parent 4c5d879650
commit 34ab603462

@ -40,6 +40,10 @@ export default {
const isOptOut = await db.optout.findOne({ where: { userID: interaction.user.id } });
if (commandName === 'optout') {
isOptOut = true
}
const timestamp = new Date();
console.log(`[${timestamp.toISOString()}] \x1b[33m${ isOptOut ? 'A user' : `${userTag} (${userID})`}\x1b[0m launched command \x1b[33m${commandName}\x1b[0m using slash`);

@ -302,7 +302,11 @@ export default {
const userTag = message.author.username;
const userID = message.author.id;
const isOptOut = await db.optout.findOne({ where: { userID: message.author.id } });
let isOptOut = await db.optout.findOne({ where: { userID: message.author.id } });
if (commandName === 'optout') {
isOptOut = true
}
const timestamp = new Date();
console.log(`[${timestamp.toISOString()}] \x1b[33m${ isOptOut ? 'A user' : `${userTag} (${userID})`}\x1b[0m launched command \x1b[33m${commandName}\x1b[0m using prefix`);

Loading…
Cancel
Save