Compare commits

...

2 commits

Author SHA1 Message Date
1edb4d8fef Add opt out 2022-09-02 09:24:12 +02:00
8ae824f025 Update description 2022-09-02 09:24:03 +02:00
3 changed files with 9 additions and 1 deletions

View file

@ -4,7 +4,7 @@ import db from '../../models/index.js';
export default { export default {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName('optout') .setName('optout')
.setDescription('Opt out of the quotation command.'), .setDescription('Opt out of the non commands features.'),
category: 'utility', category: 'utility',
async execute(interaction, args, client) { async execute(interaction, args, client) {
const isOptOut = await db.optout.findOne({ where: { userID: interaction.user.id } }); const isOptOut = await db.optout.findOne({ where: { userID: interaction.user.id } });

View file

@ -1,5 +1,6 @@
import { EmbedBuilder } from 'discord.js'; import { EmbedBuilder } from 'discord.js';
import fs from 'node:fs'; import fs from 'node:fs';
import db from '../../models/index.js';
global.boards = {}; global.boards = {};
export default { export default {
@ -19,6 +20,9 @@ export default {
}); });
} }
const isOptOut = await db.optout.findOne({ where: { userID: reaction.message.author } });
if (isOptOut) return;
let starboardChannel, shameboardChannel; let starboardChannel, shameboardChannel;
let reactionCount = reaction.count; let reactionCount = reaction.count;

View file

@ -1,5 +1,6 @@
import { EmbedBuilder } from 'discord.js'; import { EmbedBuilder } from 'discord.js';
import fs from 'node:fs'; import fs from 'node:fs';
import db from '../../models/index.js';
global.boards = {}; global.boards = {};
export default { export default {
@ -19,6 +20,9 @@ export default {
}); });
} }
const isOptOut = await db.optout.findOne({ where: { userID: reaction.message.author } });
if (isOptOut) return;
let starboardChannel, shameboardChannel; let starboardChannel, shameboardChannel;
let reactionCount = reaction.count; let reactionCount = reaction.count;