forked from Supositware/Haha-Yes
Consider user already opted out when they run /optout to avoid logging them
This commit is contained in:
parent
4c5d879650
commit
34ab603462
2 changed files with 9 additions and 1 deletions
|
@ -40,6 +40,10 @@ export default {
|
||||||
|
|
||||||
const isOptOut = await db.optout.findOne({ where: { userID: interaction.user.id } });
|
const isOptOut = await db.optout.findOne({ where: { userID: interaction.user.id } });
|
||||||
|
|
||||||
|
if (commandName === 'optout') {
|
||||||
|
isOptOut = true
|
||||||
|
}
|
||||||
|
|
||||||
const timestamp = new Date();
|
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`);
|
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 userTag = message.author.username;
|
||||||
const userID = message.author.id;
|
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();
|
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`);
|
console.log(`[${timestamp.toISOString()}] \x1b[33m${ isOptOut ? 'A user' : `${userTag} (${userID})`}\x1b[0m launched command \x1b[33m${commandName}\x1b[0m using prefix`);
|
||||||
|
|
Loading…
Reference in a new issue