fix: Edit logic

This commit is contained in:
Siwoo Jeon 2024-09-28 20:50:56 +09:00
parent f4b479a9ca
commit 355fd0b1f3
Signed by: migan
GPG key ID: 036E9A8C5E8E48DA
2 changed files with 45 additions and 45 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "muffinbot", "name": "muffinbot",
"version": "4.0.0-pudding.experimental_slash_test.1", "version": "4.0.0-pudding.experimental_slash_test.2",
"main": "dist/index.js", "main": "dist/index.js",
"private": true, "private": true,
"dependencies": { "dependencies": {

View file

@ -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 { Command, container } from '@sapphire/framework'
import { ApplyOptions } from '@sapphire/decorators' import { ApplyOptions } from '@sapphire/decorators'
import { platform, arch } from 'os' import { platform, arch } from 'os'
@ -17,8 +17,10 @@ class InformationCommand extends Command {
) )
} }
private async _embed(): Promise<APIEmbed> { private async _run(ctx: Message | ChatInputCommandInteraction) {
return { await ctx.reply({
embeds: [
{
title: `${this.container.client.user?.username}의 정ㅂ보`, title: `${this.container.client.user?.username}의 정ㅂ보`,
fields: [ fields: [
{ {
@ -56,19 +58,17 @@ class InformationCommand extends Command {
thumbnail: { thumbnail: {
url: this.container.client.user!.displayAvatarURL()!, url: this.container.client.user!.displayAvatarURL()!,
}, },
} },
],
})
} }
public async messageRun(msg: Message) { public async messageRun(msg: Message) {
await msg.reply({ await this._run(msg)
embeds: [await this._embed()],
})
} }
public async chatInputRun(interaction: ChatInputCommandInteraction) { public async chatInputRun(interaction: ChatInputCommandInteraction) {
await interaction.reply({ await this._run(interaction)
embeds: [await this._embed()],
})
} }
} }