diff --git a/src/commands/learn.ts b/src/commands/learn.ts index 07412f6..d50362c 100644 --- a/src/commands/learn.ts +++ b/src/commands/learn.ts @@ -1,7 +1,12 @@ import { Learn } from '../lib/databases' import { ApplyOptions } from '@sapphire/decorators' import { Args, Command } from '@sapphire/framework' -import { ChatInputCommandInteraction, EmbedBuilder, Message } from 'discord.js' +import { + ChatInputCommandInteraction, + EmbedBuilder, + Message, + MessageFlags, +} from 'discord.js' import { josa } from 'es-hangul' @ApplyOptions({ @@ -57,12 +62,7 @@ export default class LearnCommand extends Command { let result: string | undefined if (typeof this.detailedDescription === 'string') return - if (ctx instanceof ChatInputCommandInteraction) { - await ctx.deferReply() - - command = ctx.options.getString('단어', true) - result = ctx.options.getString('대답', true) - } else { + if (ctx instanceof Message) { if (!args) return command = (await args.pick('string').catch(() => undefined))?.replaceAll( '_', @@ -72,6 +72,11 @@ export default class LearnCommand extends Command { '_', ' ', ) + } else { + await ctx.deferReply({ flags: MessageFlags.Ephemeral }) + + command = ctx.options.getString('단어', true) + result = ctx.options.getString('대답', true) } if (!command || !result) diff --git a/src/init.ts b/src/init.ts index 9cbf368..ed5e795 100644 --- a/src/init.ts +++ b/src/init.ts @@ -26,7 +26,7 @@ declare module '@sapphire/framework' { container.dbDisconnect = async () => await disconnect() container.config = new Config() container.prefix = container.config.bot.prefix -container.version = '5.0.0-newMuffin.e250301a' +container.version = '5.0.0-newMuffin.e250302a' container.embedColors = { default: 0xaddb87, fail: 0xff0000,