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",
"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": {

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