diff --git a/commands/devel.js b/commands/devel.js index 8e80d1a..4c30acf 100644 --- a/commands/devel.js +++ b/commands/devel.js @@ -78,11 +78,12 @@ module.exports = { if (subcommand === 'reload') { const { exec } = require('child_process'); + await interaction.reply({ content: 'Reloading...', ephemeral: true }) + exec('pm2 restart 0', async (err, stdout, stderr) => { if (err) { await interaction.reply({ content: 'Error while reloading: ' + err, ephemeral: true }) } - await interaction.reply({ content: 'Reloading...', ephemeral: true }) }) } diff --git a/config/options.json b/config/options.json index c2299fe..846df39 100644 --- a/config/options.json +++ b/config/options.json @@ -4,5 +4,6 @@ "staffApplicationsChannel": "1039258641393520700", "inactivityLogChannel": "829742524796239882", "staffOtherChannel": "1082036748558803104", - "hypixelGuildID": "5a353a170cf2e529044f2935" + "hypixelGuildID": "5a353a170cf2e529044f2935", + "botLogChannel": "1101144489306886226" } \ No newline at end of file diff --git a/index.js b/index.js index 22cc6cc..251556c 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,5 @@ const { Client, GatewayIntentBits, Partials, ActivityType, Events, Collection } = require('discord.js'); +const { botLogChannel, color } = require('./config/options.json'); const env = require('dotenv').config(); const token = process.env.TOKEN; const mongoURI = process.env.MONGOURI; @@ -165,6 +166,19 @@ for (const file of modalFiles) { } client.on(Events.ClientReady, () => { console.log("Logged in as " + client.user.tag + "!"); + const channel = client.channels.cache.get(botLogChannel); + const embedColor = Number(color.replace('#', '0x')) + + if (!channel) { + return; + } + + channel.send({ + embeds: [{ + description: `Bot is online!`, + color: embedColor + }] + }); }); client.on(Events.ClientReady, () => {