discord-bot-status
v1.2.0
Published
A package that automatically displays bot status (online/offline, ping) in a specified Discord channel with real-time updates.
Downloads
155
Readme
Discord Bot Status
discord-bot-status
is a Node.js package that automatically displays the real-time status (online, offline, idle, DND) and ping of a Discord bot in a specified channel.
Installation
Install the package with npm:
npm install discord-bot-status
Usage
Create a new index.js file
const { Client, Intents } = require('discord.js');
const BotStatus = require('discord-bot-status');
const client = new Client({
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES]
});
const CHANNEL_ID = 'YOUR_CHANNEL_ID'; // Replace with the ID of the channel where you want the status displayed
client.once('ready', () => {
const botStatus = new BotStatus(client, CHANNEL_ID);
botStatus.startStatusUpdates();
});
client.login(process.env.BOT_TOKEN); // Securely pass the token through an environment variable