yaejunyang/packages/bot/commands/getStatus.ts
2026-02-09 18:31:56 +00:00

22 lines
No EOL
856 B
TypeScript

import { AttachmentBuilder, ChatInputCommandInteraction, MessageFlags, SlashCommandBuilder } from "discord.js";
import { defineCommand } from "../command";
import { OutputHandler } from "../../utils/outputHandler";
export default defineCommand(
new SlashCommandBuilder()
.setName("상태")
.setDescription("예주의 상태를 확인해요"),
async (interaction: ChatInputCommandInteraction): Promise<any> => {
if (interaction.guild == null)
return interaction.reply("올바르지 않은 서버에요");
const buffer = Buffer.from(await OutputHandler.getErrorLog(), 'utf-8');
const attachment = new AttachmentBuilder(buffer, { name: 'result.txt' });
await interaction.reply({
content: "제 상태에요",
files: [attachment]
});
},
true
)