26 lines
792 B
TypeScript
26 lines
792 B
TypeScript
import {
|
|
AttachmentBuilder,
|
|
ChatInputCommandInteraction,
|
|
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,
|
|
);
|