From 10434adad478d21bbb834a5803125db9f54c9d6c Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Wed, 2 Apr 2025 02:21:41 -0400 Subject: Added i18n (basic); Blacklist feature; Put error msg into a file --- bot/src/commands/quote.js | 4 ++++ bot/src/commands/settings.js | 2 +- bot/src/commands/suggest.js | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'bot/src/commands') diff --git a/bot/src/commands/quote.js b/bot/src/commands/quote.js index 79f05de..6d30847 100644 --- a/bot/src/commands/quote.js +++ b/bot/src/commands/quote.js @@ -8,6 +8,7 @@ import { } from 'discord.js'; import { pendingQuote, quote as quoteDB } from '../db/models/quote.js'; import { abEmbedColour } from '../storage/consts.js'; +import { blacklistCheck } from '../storage/functions.js'; // import { setTimeout as wait } from 'node:timers/promises'; // // let setupMessage = 'Welcome to the AleeBot Quote Setup!\n'; @@ -35,6 +36,9 @@ export default { .setDescription('Got a quote? Add it here!')), async execute(interaction) { if (interaction.options.getSubcommand() === 'add') { + const isBlacklisted = await blacklistCheck(interaction); + if (isBlacklisted) return; + const modal = new ModalBuilder() .setCustomId(`newQuote-${interaction.user.id}`) .setTitle('New Quote for AleeBot'); diff --git a/bot/src/commands/settings.js b/bot/src/commands/settings.js index 872bbd7..a6da979 100644 --- a/bot/src/commands/settings.js +++ b/bot/src/commands/settings.js @@ -38,7 +38,7 @@ export default { .addBooleanOption(option => option .setName('llmtoggle') - .setDescription('Toggle LLM Chatbot.'))) + .setDescription('Toggle LLM (Ollama) Chatbot.'))) .addSubcommand(subcommand => subcommand .setName('clear') diff --git a/bot/src/commands/suggest.js b/bot/src/commands/suggest.js index e841c15..77478b1 100644 --- a/bot/src/commands/suggest.js +++ b/bot/src/commands/suggest.js @@ -9,6 +9,7 @@ import { } from 'discord.js'; import { abEmbedColour, featureSuggestChannel } from '../storage/consts.js'; import { guildSettings } from '../db/models/guild-settings.js'; +import { blacklistCheck } from '../storage/functions.js'; export default { data: new SlashCommandBuilder() @@ -24,6 +25,9 @@ export default { .setDescription('Suggest something for this server.')), async execute(interaction) { if (interaction.options.getSubcommand() === 'feature') { + const isBlacklisted = await blacklistCheck(interaction); + if (isBlacklisted) return; + const modal = new ModalBuilder() .setCustomId(`suggest-${interaction.user.id}`) .setTitle('Suggest a feature for AleeBot'); -- cgit v1.2.3