delios
delios
Explore posts from servers
SIASapphire - Imagine a framework
Created by delios on 11/15/2024 in #sapphire-support
Constantly getting "The application did not respond"
Hello, I am constantly getting the "The application did not respond" message. Not matter what I try to achieve the only thing that is fast enough to execute is a simple await interaction.reply('bla bla'). Anytime I try to do something from bulkDelete to sending embeds or creating buttons, I get the thing. Is there anything to try and debug that? Is it possible that my computer is too slow for developing a bot (lmao, it is not that slow though). Obviously defering doesn't do a thing. At first I thought my code was wrong but sometimes it works, sometimes it doesn't... One thing remains, this damn message telling me it didn't respond. Maybe there is a problem with how Sapphire handles my commands right now, found somewhere that a command handler could mess things up and take too long to load up the commands so in the meantime, no response... I really don't know what's happening, again if you have some kind of super debugging stuff or I don't know I'll take it
41 replies
SIASapphire - Imagine a framework
Created by delios on 11/14/2024 in #sapphire-support
"The application did not respond" on bulkDelete message use
Hello, just built my first slash command, what I coded seems fair though the command doesn't seem to be registered. When writing down / I don't even see my bot appearing (only the built-in stuff). Does the code seem fair? I can't see any major mistake that would make it not register...
import { Command } from '@sapphire/framework';

export class ClearCommand extends Command {
constructor(context, options) {
super(context, {
...options,
name: 'clear',
description: 'Supprime les derniers messages du salon actuel',
aliases: ['purge'],
preconditions: ['AdminOnly'],
idHints: ['1306666895696593017']
});
}

registerApplicationCommands(registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName(this.name)
.setDescription(this.description)
.addIntegerOption((option) =>
option
.setName('nombre')
.setDescription('Nombre de message à supprimer')
.setRequired(true)
)
);
}

chatInputRun(interaction) {
const channel = interaction.channel;

const messagesToDelete = interaction.options.getInteger('nombre');

if (messagesToDelete > 100) {
return interaction.reply({
content: 'Vous ne pouvez pas supprimer plus de 100 messages à la fois',
ephemeral: true,
});
}

return channel.bulkDelete(messagesToDelete)
.then(() => {
interaction.reply({
content: `Messages supprimés avec succès`,
ephemeral: true,
});
})
}
}
import { Command } from '@sapphire/framework';

export class ClearCommand extends Command {
constructor(context, options) {
super(context, {
...options,
name: 'clear',
description: 'Supprime les derniers messages du salon actuel',
aliases: ['purge'],
preconditions: ['AdminOnly'],
idHints: ['1306666895696593017']
});
}

registerApplicationCommands(registry) {
registry.registerChatInputCommand((builder) =>
builder
.setName(this.name)
.setDescription(this.description)
.addIntegerOption((option) =>
option
.setName('nombre')
.setDescription('Nombre de message à supprimer')
.setRequired(true)
)
);
}

chatInputRun(interaction) {
const channel = interaction.channel;

const messagesToDelete = interaction.options.getInteger('nombre');

if (messagesToDelete > 100) {
return interaction.reply({
content: 'Vous ne pouvez pas supprimer plus de 100 messages à la fois',
ephemeral: true,
});
}

return channel.bulkDelete(messagesToDelete)
.then(() => {
interaction.reply({
content: `Messages supprimés avec succès`,
ephemeral: true,
});
})
}
}
Also I get this in the console if that means something
[DEBUG] ApplicationCommandRegistry[clear] Preparing to process 1 possible command registrations / updates...
[DEBUG] ApplicationCommandRegistry[clear] Checking if command "clear" is identical with global chat input command with id "1306666895696593017"
[DEBUG] ApplicationCommandRegistry[clear] Registering id "1306666895696593017" to internal chat input map
[DEBUG] ApplicationCommandRegistry[clear] Took 1ms to process differences via fast compute differences
[DEBUG] ApplicationCommandRegistry[clear] Found differences for command "clear" (1306666895696593017) versus provided api data.
[DEBUG] ApplicationCommandRegistry[clear] Updated command clear (1306666895696593017) with new api data
[INFO] ApplicationCommandRegistries: Took 251ms to initialize.
[DEBUG] ApplicationCommandRegistry[clear] Preparing to process 1 possible command registrations / updates...
[DEBUG] ApplicationCommandRegistry[clear] Checking if command "clear" is identical with global chat input command with id "1306666895696593017"
[DEBUG] ApplicationCommandRegistry[clear] Registering id "1306666895696593017" to internal chat input map
[DEBUG] ApplicationCommandRegistry[clear] Took 1ms to process differences via fast compute differences
[DEBUG] ApplicationCommandRegistry[clear] Found differences for command "clear" (1306666895696593017) versus provided api data.
[DEBUG] ApplicationCommandRegistry[clear] Updated command clear (1306666895696593017) with new api data
[INFO] ApplicationCommandRegistries: Took 251ms to initialize.
37 replies
SIASapphire - Imagine a framework
Created by delios on 12/6/2023 in #sapphire-support
Command not being registered
Hello, I'm currently following the guide for Sapphire and here's the first error, I can't seem to be able to register a command, that must be the dumbest mistake you've ever seen but after going throught the code a few times I can't get the error... Any idea ? https://pastebin.com/XSEepVsP By not being registered I mean when I type / it doesn't suggest anything from the bot and doesn't work anyway
4 replies