From 355fd0b1f3671b2dc2c84e8edc5c299b2021f212 Mon Sep 17 00:00:00 2001 From: Siwoo Jeon Date: Sat, 28 Sep 2024 20:50:56 +0900 Subject: [PATCH] fix: Edit logic --- package.json | 2 +- src/Commands/information.ts | 88 ++++++++++++++++++------------------- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/package.json b/package.json index d5e008c..2b1c14f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "muffinbot", - "version": "4.0.0-pudding.experimental_slash_test.1", + "version": "4.0.0-pudding.experimental_slash_test.2", "main": "dist/index.js", "private": true, "dependencies": { diff --git a/src/Commands/information.ts b/src/Commands/information.ts index c602ce3..8061751 100644 --- a/src/Commands/information.ts +++ b/src/Commands/information.ts @@ -1,4 +1,4 @@ -import { type ChatInputCommandInteraction, APIEmbed, Message } from 'discord.js' +import type { ChatInputCommandInteraction, Message } from 'discord.js' import { Command, container } from '@sapphire/framework' import { ApplyOptions } from '@sapphire/decorators' import { platform, arch } from 'os' @@ -17,58 +17,58 @@ class InformationCommand extends Command { ) } - private async _embed(): Promise { - return { - title: `${this.container.client.user?.username}의 정ㅂ보`, - fields: [ + private async _run(ctx: Message | ChatInputCommandInteraction) { + await ctx.reply({ + embeds: [ { - name: '구동ㅎ환경', - value: `${platform()} ${arch()}`, - inline: false, - }, - { - name: '버ㅈ전', - value: this.container.version, - inline: true, - }, - { - name: '채ㄴ널', - value: this.container.channel.toLowerCase(), - inline: true, - }, - { - name: '최근 업ㄷ데이트 날짜', - value: this.container.lastUpdated.toLocaleDateString('ko', { - dateStyle: 'long', - }), - inline: true, - }, - { - name: '개ㅂ발자', - value: ( - await this.container.client.users.fetch( - this.container.config.bot.owner_ID, - ) - ).username, - inline: false, + title: `${this.container.client.user?.username}의 정ㅂ보`, + fields: [ + { + name: '구동ㅎ환경', + value: `${platform()} ${arch()}`, + inline: false, + }, + { + name: '버ㅈ전', + value: this.container.version, + inline: true, + }, + { + name: '채ㄴ널', + value: this.container.channel.toLowerCase(), + inline: true, + }, + { + name: '최근 업ㄷ데이트 날짜', + value: this.container.lastUpdated.toLocaleDateString('ko', { + dateStyle: 'long', + }), + inline: true, + }, + { + name: '개ㅂ발자', + value: ( + await this.container.client.users.fetch( + this.container.config.bot.owner_ID, + ) + ).username, + inline: false, + }, + ], + thumbnail: { + url: this.container.client.user!.displayAvatarURL()!, + }, }, ], - thumbnail: { - url: this.container.client.user!.displayAvatarURL()!, - }, - } + }) } public async messageRun(msg: Message) { - await msg.reply({ - embeds: [await this._embed()], - }) + await this._run(msg) } public async chatInputRun(interaction: ChatInputCommandInteraction) { - await interaction.reply({ - embeds: [await this._embed()], - }) + await this._run(interaction) } }