mirror of
https://github.com/thedrewen/protojx-manager.git
synced 2026-03-21 01:48:54 +01:00
fix(status): update host addresses and remove unused attachment logic in status command
This commit is contained in:
@@ -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});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user