© 2026 Hedgehog Software, LLC
import { Command } from '@sapphire/framework'; import type { Message } from 'discord.js'; export class PingCommand extends Command { public constructor(context: Command.Context, options: Command.Options) { super(context, { ...options, name: 'ping', aliases: ['pong'], description: 'ping pong' }); } public async messageRun(message: 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); } }
import { SapphireClient } from '@sapphire/framework'; const client = new SapphireClient({ defaultPrefix: "-", caseInsensitiveCommands: true, loadMessageCommandListeners: true, intents: 8705 }); async function runBot() { await client.login(''); console.log("Bot | Online"); } runBot();
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