diff options
| author | Andrew Lee <andrew@alee14.me> | 2025-03-03 11:42:27 -0500 |
|---|---|---|
| committer | Andrew Lee <andrew@alee14.me> | 2025-03-03 11:42:27 -0500 |
| commit | fd7f8eba960981482fabf350995bf753feebb176 (patch) | |
| tree | 2bd0c85b09a04ecd8e1f20fc409eb4b8a22289a7 /bot/src/events/ClientReady.js | |
| parent | cf1382d88c5e3298923c8cb243b7bc5751e68b53 (diff) | |
| download | AleeBot-fd7f8eba960981482fabf350995bf753feebb176.tar.gz AleeBot-fd7f8eba960981482fabf350995bf753feebb176.tar.bz2 AleeBot-fd7f8eba960981482fabf350995bf753feebb176.zip | |
More commands ported; Almost all 2.x features have been added
Diffstat (limited to 'bot/src/events/ClientReady.js')
| -rw-r--r-- | bot/src/events/ClientReady.js | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/bot/src/events/ClientReady.js b/bot/src/events/ClientReady.js index 335a2ac..def2c88 100644 --- a/bot/src/events/ClientReady.js +++ b/bot/src/events/ClientReady.js @@ -1,8 +1,9 @@ -import { Events } from 'discord.js'; +import { EmbedBuilder, Events, version } from 'discord.js'; import { readFileSync } from 'node:fs'; import { activities } from '../storage/activities.js'; -const { version } = JSON.parse(readFileSync('./package.json', 'utf-8')); +import { readyMsg, abEmbedColour } from '../storage/consts.js'; +const { version: abVersion } = JSON.parse(readFileSync('./package.json', 'utf-8')); function botActivity(client) { const activity = activities[Math.floor(Math.random() * activities.length)]; @@ -25,10 +26,27 @@ export default { console.log('[>] AleeBot is now ready!'); console.log(`[i] Logged in as ${client.user.tag}`); console.log(`[i] Bot ID: ${client.user.id}`); - console.log(`[i] Running version ${version} | Serving in ${client.guilds.cache.size} guilds`); + console.log(`[i] Running version ${abVersion} | Serving in ${client.guilds.cache.size} guilds`); botActivity(client); + if (readyMsg) { + const readyEmbed = new EmbedBuilder() + .setAuthor({ name: 'AleeBot Status', iconURL: client.user.avatarURL() }) + .setDescription('AleeBot has started') + .addFields( + { name: 'Version', value: `${abVersion}`, inline: true }, + { name: 'Node.JS Version', value: `${process.versions.node}`, inline: true }, + { name: 'Discord.JS Version', value: `${version}`, inline: true } + ) + .setColor(abEmbedColour); + + + let statusChannel = client.channels.cache.get(process.env.statusChannelID); + if (!statusChannel) return console.error('The status channel does not exist! Skipping.'); + statusChannel.send({ embeds: [readyEmbed]}); + } + setInterval(function() { botActivity(client); }, 200000); |
