From 285e6796d0b049393b177d2d98f3ad35fc62d4ac Mon Sep 17 00:00:00 2001 From: ShuriZma Date: Wed, 3 Apr 2024 16:46:44 +0200 Subject: [PATCH] turn done messages into ephemerals --- src/commands/reset.ts | 7 +++++-- src/commands/setAutoEmbedMessages.ts | 9 ++++++--- src/commands/setChannel.ts | 11 +++++++---- src/commands/setIgnorePrefix.ts | 9 ++++++--- src/commands/setModRole.ts | 5 ++++- 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/commands/reset.ts b/src/commands/reset.ts index 5d1a534..78b4b6c 100644 --- a/src/commands/reset.ts +++ b/src/commands/reset.ts @@ -4,7 +4,7 @@ import { SlashCommandBuilder, SlashCommandStringOption, } from 'discord.js'; -import { Bot } from "../bot"; +import {Bot} from "../bot"; const option = new SlashCommandStringOption() .setName('word') @@ -27,6 +27,9 @@ export default { bot.getDB().run('DELETE FROM library WHERE TRUE'); bot.setCounter(0); console.log('completely cleared library') - return await interaction.reply('Done!'); + return await interaction.reply({ + content: 'Done!', + ephemeral: true, + }); }, }; \ No newline at end of file diff --git a/src/commands/setAutoEmbedMessages.ts b/src/commands/setAutoEmbedMessages.ts index 0516672..29f1508 100644 --- a/src/commands/setAutoEmbedMessages.ts +++ b/src/commands/setAutoEmbedMessages.ts @@ -4,7 +4,7 @@ import { SlashCommandBuilder, SlashCommandIntegerOption, } from 'discord.js'; -import { Bot } from "../bot"; +import {Bot} from "../bot"; const option = (new SlashCommandIntegerOption()) .setName('amount') @@ -20,7 +20,7 @@ export default { async execute(interaction: ChatInputCommandInteraction) { const bot = Bot.getInstance(); bot.getDB().run( - 'INSERT OR REPLACE INTO config (configKey, value) VALUES (?, ?)', + 'INSERT OR REPLACE INTO config (configkey, value) VALUES (?, ?)', [ 'autoEmbedMessages', interaction.options.data.at(0).value, @@ -30,6 +30,9 @@ export default { bot.setAutoEmbedMessages(parseInt(interaction.options.data.at(0).value.toString())); console.log('set auto embed messages to ' + interaction.options.data.at(0).value); - return await interaction.reply('Done!'); + return await interaction.reply({ + content: 'Done!', + ephemeral: true, + }); }, }; \ No newline at end of file diff --git a/src/commands/setChannel.ts b/src/commands/setChannel.ts index 2820f38..fbf3966 100644 --- a/src/commands/setChannel.ts +++ b/src/commands/setChannel.ts @@ -4,8 +4,8 @@ import { SlashCommandBuilder, SlashCommandChannelOption, } from 'discord.js'; -import { ChannelType } from 'discord-api-types/v10'; -import { Bot } from "../bot"; +import {ChannelType} from 'discord-api-types/v10'; +import {Bot} from "../bot"; const channelOption = (new SlashCommandChannelOption()) .setName('channel') @@ -22,7 +22,7 @@ export default { async execute(interaction: ChatInputCommandInteraction) { const bot = Bot.getInstance(); bot.getDB().run( - 'INSERT OR REPLACE INTO config (configKey, value) VALUES (?, ?)', + 'INSERT OR REPLACE INTO config (configkey, value) VALUES (?, ?)', [ 'channelId', interaction.options.data.at(0).value, @@ -32,6 +32,9 @@ export default { bot.setChannel(interaction.options.data.at(0).value.toString()); console.log('set channel to ' + interaction.options.data.at(0).value); - return await interaction.reply('Done!'); + return await interaction.reply({ + content: 'Done!', + ephemeral: true, + }); }, }; \ No newline at end of file diff --git a/src/commands/setIgnorePrefix.ts b/src/commands/setIgnorePrefix.ts index 6c59c1f..83495b1 100644 --- a/src/commands/setIgnorePrefix.ts +++ b/src/commands/setIgnorePrefix.ts @@ -4,7 +4,7 @@ import { SlashCommandBuilder, SlashCommandStringOption, } from 'discord.js'; -import { Bot } from "../bot"; +import {Bot} from "../bot"; const option = (new SlashCommandStringOption()) .setName('prefix') @@ -20,7 +20,7 @@ export default { async execute(interaction: ChatInputCommandInteraction) { const bot = Bot.getInstance(); bot.getDB().run( - 'INSERT OR REPLACE INTO config (configKey, value) VALUES (?, ?)', + 'INSERT OR REPLACE INTO config (configkey, value) VALUES (?, ?)', [ 'ignorePrefix', interaction.options.data.at(0).value, @@ -30,6 +30,9 @@ export default { bot.setIgnorePrefix(interaction.options.data.at(0).value.toString()); console.log('set ignore prefix to ' + interaction.options.data.at(0).value); - return await interaction.reply('Done!'); + return await interaction.reply({ + content: 'Done!', + ephemeral: true, + }); }, }; \ No newline at end of file diff --git a/src/commands/setModRole.ts b/src/commands/setModRole.ts index ecf40a9..f3584e7 100644 --- a/src/commands/setModRole.ts +++ b/src/commands/setModRole.ts @@ -30,6 +30,9 @@ export default { bot.setModRole(interaction.options.data.at(0).value.toString()); console.log('set mod role to ' + interaction.options.data.at(0).value); - return await interaction.reply('Done!'); + return await interaction.reply({ + content: 'Done!', + ephemeral: true, + }); }, }; \ No newline at end of file