Add initial presence code

This commit is contained in:
Michael 2022-12-16 11:06:38 -05:00
parent 8f44aa943e
commit 22175f32bf
2 changed files with 6 additions and 0 deletions

View file

@ -16,6 +16,7 @@ const logger = require('./utils/logging.js');
// Require the necessary discord.js classes
const { Client, Collection, Events, GatewayIntentBits } = require('discord.js');
const { token, botOwner } = require('./config.json');
const { activity, status } = require('./presence.json');
// Create a new client instance
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
@ -42,6 +43,7 @@ for (const file of commandFiles) {
// We use 'c' for the event parameter to keep it separate from the already defined 'client'
client.once(Events.ClientReady, c => {
logger.log(logger.logLevels.INFO, `${logger.colorText('Ready!', logger.textColor.Green)} Logged in as ${logger.colorText(c.user.tag, logger.textColor.Blue)}`);
client.user.setPresence({ activities: [{ name: activity }], status: status });
});
// Client "on" Events

4
presence.json Normal file
View file

@ -0,0 +1,4 @@
{
"activity": "Put your status here!",
"status": "online"
}