Devvvvvv
Devvvvvv
Explore posts from servers
SIASapphire - Imagine a framework
Created by Devvvvvv on 5/20/2024 in #sapphire-support
Cannot find how I can use buttons
I want to create a message with some buttons for people to click on and recieve some messages something like what it is in the attached image. What I cannot figure out is how do I use it. I tried to read the documentation and I'm pretty sure im missing a big gotcha https://sapphirejs.dev/docs/Guide/interaction-handlers/buttons
29 replies
SIASapphire - Imagine a framework
Created by Devvvvvv on 5/19/2024 in #sapphire-support
slashcommand wont appear
Tried to implement slash command but it wont show up. The bot is invited with the bot and application.commands scope and it still wont work. ping.js
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 { 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,
};
index.js
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);
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);
43 replies
SIASapphire - Imagine a framework
Created by Devvvvvv on 5/19/2024 in #sapphire-support
Can I create a simple get endpoint along with my sapphire app that's hosted wherever?
If yes, how can I do so?
4 replies