mirror of
https://github.com/thedrewen/protojx-manager.git
synced 2026-03-21 09:48:56 +01:00
rename file.
This commit is contained in:
33
src/commands/utility/statut.command.ts
Normal file
33
src/commands/utility/statut.command.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { ApplicationIntegrationType, ChatInputCommandInteraction, CommandInteraction, EmbedBuilder, InteractionContextType, SlashCommandBuilder } from "discord.js";
|
||||
import ping from "ping";
|
||||
import statusService from "../../services/status.service";
|
||||
|
||||
export default {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('status')
|
||||
.setDescription('Give statut of servers.')
|
||||
.setIntegrationTypes(
|
||||
ApplicationIntegrationType.GuildInstall,
|
||||
ApplicationIntegrationType.UserInstall
|
||||
)
|
||||
.setContexts(
|
||||
InteractionContextType.BotDM,
|
||||
InteractionContextType.Guild,
|
||||
InteractionContextType.PrivateChannel
|
||||
),
|
||||
async execute(interaction : ChatInputCommandInteraction) {
|
||||
await interaction.deferReply();
|
||||
|
||||
const embed = new EmbedBuilder();
|
||||
embed.setTitle('Status of protojx servers');
|
||||
embed.setColor(0xffffff);
|
||||
embed.setTimestamp(new Date());
|
||||
embed.setThumbnail(interaction.client.user.avatarURL())
|
||||
|
||||
for(let host of statusService.hosts){
|
||||
embed.addFields({name: host.name, value: host.alive ? '<a:online:1432684754276323431> Online' : '<a:offline:1432684900175183882> Offline', inline: false});
|
||||
}
|
||||
|
||||
await interaction.editReply({embeds: [embed]});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user