fix(status): update host addresses and remove unused attachment logic in status command

This commit is contained in:
2025-11-26 09:22:36 +01:00
parent aebc6be99e
commit 3f59dcc34f
2 changed files with 4 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
import { ApplicationIntegrationType, AttachmentBuilder, ChatInputCommandInteraction, InteractionContextType, MessageFlags, SlashCommandBuilder } from "discord.js";
import { ApplicationIntegrationType, ChatInputCommandInteraction, InteractionContextType, MessageFlags, SlashCommandBuilder } from "discord.js";
import statusService from "../../services/status.service";
import { CommandDefinition} from "../../type";
@@ -17,9 +17,7 @@ const cmd : CommandDefinition = {
),
async execute(interaction : ChatInputCommandInteraction) {
await interaction.deferReply();
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]});
await interaction.editReply({components: [await statusService.getUpdatedContainer()], flags: MessageFlags.IsComponentsV2});
}
}

View File

@@ -40,7 +40,7 @@ export class StatusService {
notify: true
},
{
host: '5.178.99.6',
host: '5.178.99.240',
name: 'RYZEN 02',
alive: false,
ping_type: 'ping',
@@ -56,7 +56,7 @@ export class StatusService {
notify: true
},
{
host: '154.16.254.10',
host: '144.76.35.26',
name: 'RYZEN7 04',
alive: false,
ping_type: 'ping',
@@ -405,13 +405,6 @@ export class StatusService {
});
container.addSeparatorComponents((s) => s);
if(!live) {
container.addTextDisplayComponents((t) => t.setContent('This is a status bar to test : (Ryzen7)'))
container.addMediaGalleryComponents((m) => m
.addItems((i) => i.setURL('attachment://status.png'))
);
}
container.addTextDisplayComponents((text) => text.setContent(`:globe_with_meridians: Website Status : https://statut.protojx.com/\n${live ? 'Last update : ' : ''}<t:${dayjs().unix()}:f> - Receive automatic notifications when there is an outage with /follow !`));
return container;