Add some status stuff

This commit is contained in:
Christopher Cookman 2025-01-25 09:39:00 -07:00
parent 373b6e1926
commit 28b6201a3a
2 changed files with 15 additions and 7 deletions

View file

@ -56,7 +56,11 @@ global.log = log;
client.on('ready', async () => {
log.success(`Logged in as ${client.user.displayName}`);
await client.setStatus("dnd");
await client.setActivity({
type: Discord.ActivityType.Custom,
name: "Just chillin"
})
const commands = require("./commands")
// Command registration
log.info("Registering commands...")

View file

@ -1,5 +1,5 @@
const { exec } = require('child_process');
const Discord = require('discord.js');
const pool = global.pool
const fpbx = global.fpbx
const client = global.client
@ -52,6 +52,12 @@ module.exports.execute = async (interaction) => {
});
break;
case 'reboot': // Run `reboot 0`
await interaction.reply({ content: "Rebooting...", ephemeral: true });
await client.setStatus("dnd");
await client.setActivity({
type: Discord.ActivityType.Custom,
name: "Server Rebooting..."
})
await client.destroy();
log.info('Client destroyed.');
pool.end((err) => {
@ -61,9 +67,7 @@ module.exports.execute = async (interaction) => {
log.info('Database pool closed.');
}
});
runCommand('reboot 0').then((res) => {
interaction.reply({ content: "Rebooting...", ephemeral: true });
});
runCommand('reboot 0');
break;
}
}