mirror of
https://github.com/TheShadowEevee/Konpeki-Discord-Bot.git
synced 2025-01-11 14:38:49 -06:00
Add initial presence code
This commit is contained in:
parent
8f44aa943e
commit
22175f32bf
2 changed files with 6 additions and 0 deletions
2
index.js
2
index.js
|
@ -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
4
presence.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"activity": "Put your status here!",
|
||||
"status": "online"
|
||||
}
|
Loading…
Reference in a new issue