mirror of
https://github.com/thedrewen/protojx-manager.git
synced 2026-03-21 09:48:56 +01:00
feat: add canvas dependency and implement uptime bar image generation
- Added 'canvas' dependency to package.json and package-lock.json. - Updated getUpdatedContainer method in StatusService to be asynchronous. - Implemented getStatusImageBar method in StatusService to generate a visual representation of uptime data. - Modified live_status.command.ts and statut.command.ts to await the updated container. - Created test.ts to demonstrate uptime bar generation and save it as an image. - Updated tsconfig.json to target ES2024 and include relevant libraries.
This commit is contained in:
@@ -28,7 +28,7 @@ const cmd : CommandDefinition = {
|
||||
if(channel?.isSendable()) {
|
||||
let message;
|
||||
try {
|
||||
message = await channel.send({components: [statusService.getUpdatedContainer(true)], flags: [MessageFlags.IsComponentsV2]});
|
||||
message = await channel.send({components: [await statusService.getUpdatedContainer(true)], flags: [MessageFlags.IsComponentsV2]});
|
||||
} catch (error) {
|
||||
await interaction.editReply({content: 'An error has occurred. Please check the permissions for the channel.'});
|
||||
return;
|
||||
|
||||
@@ -17,7 +17,7 @@ const cmd : CommandDefinition = {
|
||||
),
|
||||
async execute(interaction : ChatInputCommandInteraction) {
|
||||
await interaction.deferReply();
|
||||
await interaction.editReply({components: [statusService.getUpdatedContainer()], flags: MessageFlags.IsComponentsV2});
|
||||
await interaction.editReply({components: [await statusService.getUpdatedContainer()], flags: MessageFlags.IsComponentsV2});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user