Add guild add notif

This commit is contained in:
Skylar Grant 2023-06-08 17:51:41 -04:00
parent e05bd20f1f
commit 4144dde4d6

10
main.js
View File

@ -26,6 +26,7 @@ const fn = require('./modules/functions.js');
const strings = require('./data/strings.json');
const dbfn = require('./modules/dbfn.js');
const isDev = process.env.DEBUG;
let statusChannel;
client.once('ready', async () => {
fn.collectionBuilders.slashCommands(client);
@ -37,10 +38,9 @@ client.once('ready', async () => {
// checkRateLimits();
console.log('Ready!');
client.user.setActivity({ name: `${serverCount} trees grow.`, type: ActivityType.Watching });
statusChannel = await client.channels.fetch(statusChannelId);
if (isDev == 'false') {
client.channels.fetch(statusChannelId).then(channel => {
channel.send(`${new Date().toISOString()} -- \nStartup Sequence Complete <@481933290912350209>`);
});
statusChannel.send(`${new Date().toISOString()} -- \nStartup Sequence Complete <@481933290912350209>`);
}
});
@ -124,6 +124,10 @@ client.on('messageCreate', async message => {
return;
});
client.on('guildCreate', async guild => {
await statusChannel.send(`I've been added to a new guild: ${guild.name} (${guild.id})`);
});
async function checkRateLimits(hi) {
const axios = require('axios');