© 2026 Hedgehog Software, LLC
const { Command } = require('@sapphire/framework'); class PingCommand extends Command { constructor(context, options) { super(context, { ...options, name: 'ping', aliases: ['pong'], description: 'ping pong', }); } async messageRun(message) { const msg = await message.channel.send('Ping?'); const content = `Pong from JavaScript! Bot Latency ${Math.round( this.container.client.ws.ping )}ms. API Latency ${ msg.createdTimestamp - message.createdTimestamp }ms.`; return msg.edit(content); } } module.exports = { PingCommand, };
const { SapphireClient } = require('@sapphire/framework'); const { GatewayIntentBits } = require('discord.js'); require('dotenv').config(); const client = new SapphireClient({ intents: [ GatewayIntentBits.MessageContent, GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, ], loadMessageCommandListeners: true, }); client.login(process.env.TOKEN);
Join the Discord to ask follow-up questions and connect with the community
Sapphire is a next-gen object-oriented Discord.js bot framework.
2,286 Members