test
This commit is contained in:
parent
9b648e6e73
commit
2468bdc116
@ -58,7 +58,25 @@ module.exports = {
|
||||
headers: headers
|
||||
});
|
||||
|
||||
await interaction.editReply('✅ Redémarrage du serveur terminé ! Le serveur devrait être disponible dans quelques instants...');
|
||||
var run = false;
|
||||
while (!run) {
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
const checkResponse = await axios.get('https://panel.louismazin.ovh/api/client/servers/ae4a628f/resources', {
|
||||
headers: headers
|
||||
});
|
||||
|
||||
const newState = checkResponse.data.attributes.current_state;
|
||||
|
||||
if (newState === 'running') {
|
||||
run = true;
|
||||
await interaction.editReply('✅ Le serveur Palworld a été redémarré avec succès !');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Erreur lors de la vérification de l\'état du serveur:', error);
|
||||
}
|
||||
}, 5000); // Vérifier après 5 secondes
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('Erreur lors du redémarrage du serveur:', error);
|
||||
|
Loading…
x
Reference in New Issue
Block a user