feat(status): enhance status command with image attachment and update query logic

This commit is contained in:
2025-11-25 10:37:00 +01:00
parent e41be1e1f0
commit 401ae56113
2 changed files with 9 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
import { ApplicationIntegrationType, ChatInputCommandInteraction, InteractionContextType, MessageFlags, SlashCommandBuilder } from "discord.js";
import { ApplicationIntegrationType, AttachmentBuilder, ChatInputCommandInteraction, InteractionContextType, MessageFlags, SlashCommandBuilder } from "discord.js";
import statusService from "../../services/status.service";
import { CommandDefinition} from "../../type";
@@ -17,7 +17,9 @@ const cmd : CommandDefinition = {
),
async execute(interaction : ChatInputCommandInteraction) {
await interaction.deferReply();
await interaction.editReply({components: [await statusService.getUpdatedContainer()], flags: MessageFlags.IsComponentsV2});
let status = await statusService.getStatusImageBar('154.16.254.10');
const attachment = new AttachmentBuilder(status, {name: 'status.png'});
await interaction.editReply({components: [await statusService.getUpdatedContainer()], flags: MessageFlags.IsComponentsV2, files: [attachment]});
}
}