guild commands not showing in command lookup

Another thread was posted about this just over a week ago, but the OP deleted his message. Basically, like the thread title says, I have a guild command, generated by the CLI, and it's just not showing in the command picker thing. Here's the code for the command:
import { ApplyOptions } from '@sapphire/decorators';
import { Command } from '@sapphire/framework';

@ApplyOptions<Command.Options>({
name: 'ping',
description: 'A basic slash command'
})
export class UserCommand extends Command {
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand((builder) =>
builder //
.setName(this.name)
.setDescription(this.description),
{
guildIds: ['1030563119132594187'],
// idHints: []
}
);
}

public override async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
return interaction.reply({ content: 'Hello world!' });
}
}
import { ApplyOptions } from '@sapphire/decorators';
import { Command } from '@sapphire/framework';

@ApplyOptions<Command.Options>({
name: 'ping',
description: 'A basic slash command'
})
export class UserCommand extends Command {
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand((builder) =>
builder //
.setName(this.name)
.setDescription(this.description),
{
guildIds: ['1030563119132594187'],
// idHints: []
}
);
}

public override async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
return interaction.reply({ content: 'Hello world!' });
}
}
38 Replies
Favna
Favna2y ago
- Are you seeing any Sapphire logging regarding the registering of the slash command? - related: What log level have you set? In development we recommend DEBUG - Is the bot actually in that server - Did you invite the bot with the applications.commands scope? - Are you 100% sure the guild id is correct? As for the person who deleted their message, not sure which you mean but if you're referring to https://discord.com/channels/737141877803057244/1070689837432193115/1070700161023606795 then it was that they had the wrong ID
SadlyNotSappho
a: no, i'm not actually a1: whatever the default one that the CLI generated is lol b: yes c: i think so?????? i'll check again in like an hour and a half d: it fuckin better be i was talking about https://discord.com/channels/737141877803057244/1070357639055282178 the log level is set to LogLevel.Debug
Favna
Favna2y ago
ah well I deleted that thread now as they requested..
SadlyNotSappho
here's the output from docker-compose
[9:38:50 PM] Starting compilation in watch mode...
discord-button-roles-sapphire-sample-bot-1 |
discord-button-roles-sapphire-sample-bot-1 | [9:38:51 PM] Found 0 errors. Watching for file changes.
discord-button-roles-sapphire-sample-bot-1 |
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:51 - INFO - Logging in
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - logged in
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ApplicationCommandRegistries: Initializing...
discord-button-roles-sapphire-sample-bot-1 | 1.0.0
discord-button-roles-sapphire-sample-bot-1 | [+] Gateway
discord-button-roles-sapphire-sample-bot-1 | </> DEVELOPMENT MODE
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ├─ Loaded 26 arguments.
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ├─ Loaded 2 commands.
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ├─ Loaded 0 interaction-handlers.
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ├─ Loaded 34 listeners.
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ├─ Loaded 14 preconditions.
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ├─ Loaded 0 routes.
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ├─ Loaded 3 mediaParsers.
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - └─ Loaded 3 middlewares.
discord-button-roles-sapphire-sample-bot-1 | Ready!
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ApplicationCommandRegistries: Took 357ms to initialize.
[9:38:50 PM] Starting compilation in watch mode...
discord-button-roles-sapphire-sample-bot-1 |
discord-button-roles-sapphire-sample-bot-1 | [9:38:51 PM] Found 0 errors. Watching for file changes.
discord-button-roles-sapphire-sample-bot-1 |
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:51 - INFO - Logging in
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - logged in
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ApplicationCommandRegistries: Initializing...
discord-button-roles-sapphire-sample-bot-1 | 1.0.0
discord-button-roles-sapphire-sample-bot-1 | [+] Gateway
discord-button-roles-sapphire-sample-bot-1 | </> DEVELOPMENT MODE
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ├─ Loaded 26 arguments.
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ├─ Loaded 2 commands.
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ├─ Loaded 0 interaction-handlers.
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ├─ Loaded 34 listeners.
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ├─ Loaded 14 preconditions.
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ├─ Loaded 0 routes.
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ├─ Loaded 3 mediaParsers.
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - └─ Loaded 3 middlewares.
discord-button-roles-sapphire-sample-bot-1 | Ready!
discord-button-roles-sapphire-sample-bot-1 | 2023-02-10 21:38:52 - INFO - ApplicationCommandRegistries: Took 357ms to initialize.
Favna
Favna2y ago
not like it was adding much anyway lol
SadlyNotSappho
lmao yeah
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand(
(builder) => {
builder //
.setName(this.name)
.setDescription(this.description);
},
{
guildIds: ['1030563119132594187']
// idHints: []
}
);
}
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand(
(builder) => {
builder //
.setName(this.name)
.setDescription(this.description);
},
{
guildIds: ['1030563119132594187']
// idHints: []
}
);
}
...this is the correct way to do guild ids, yes? i used sapphire a long time ago, it might have changed completely since then, but this is mostly what i remember
Favna
Favna2y ago
uhm looks like the application command isnt being detected? That is peculiar. Can you dump your whole code on github or in a zip?
SadlyNotSappho
yeah gimme three secs to push my changes i host my own git server, is it ok if i send a link to that?
Favna
Favna2y ago
sure as long as it's public
SadlyNotSappho
wdym by public? i haven't set up an email server, so i don't have it set up so that anyone can just make an account (i think), but it's a publicly accesable server
Favna
Favna2y ago
the latter yes wasn't planning to set up a VPN or something just to access a bit of code lol
SadlyNotSappho
oh lol
SadlyNotSappho
Forgejo: Beyond coding. We forge.
discord-button-roles
A Discord bot that serves one purpose: button roles, as I haven't found a good free one, that doesn't also have a million other features.
SadlyNotSappho
yeah here's the server
Favna
Favna2y ago
huh. What's the base for that btw? Doesnt look like GitLab.
SadlyNotSappho
forgejo smth my friend recommended from what i understand, it's basically gitea but forked to not be ran by a for profit
Favna
Favna2y ago
wow I completely misread that. it's Forge-jo, not For-egjo lol
SadlyNotSappho
i actually gotta run to get to an in person class, i'll be back in like an hour and a half? lmao nice
Favna
Favna2y ago
Btw you have both a package-lock.json and yarn.lock. You should decide between either yarn or npm tbh.
SadlyNotSappho
I'm like 99% sure that Sapphire's CLI generated both of them for me lol there's always that 1% tho
Favna
Favna2y ago
this will be the 1% because the CLI only runs one of the two and the template code doesnt have either oh wait no I see, it's a thing with the docker template
Favna
Favna2y ago
Just put a token in and changed the guild id to a server that my test bot is in and it works just fine:
SadlyNotSappho
that's odd oh fuck what're your intents I mighta messed those up
Favna
Favna2y ago
all but it's a test bot and slash commands dont need specific intents
SadlyNotSappho
yeah that's really weird I'll mess with it later wait, your docker template came with a slashcommand?
Favna
Favna2y ago
Dunno what you mean, I just downloaded the git repo you send.
SadlyNotSappho
oH thought you meant you made a new thing with the docker template instead of cloning my repo oh fuck what nodejs version is it supposed to be using
Favna
Favna2y ago
>= 16.9
SadlyNotSappho
i'm on v19.6.0, should be fine yeah no i have no idea what's going on
Favna
Favna2y ago
Besides, the docker container is what really matters for node version and that's 16.x as well.
SadlyNotSappho
ok i genuinely have no idea how i'd go about debugging this is there some special intent i need to enable? i'm blaming this on some stupid config issue
SadlyNotSappho
oh yes, i had some suspicions that it was somehow just my client but no, it just hates me
SadlyNotSappho
it's also not trying to register it if i remove the guildIds from it, so yeah something's seriously fucked WHAT THE FUCK
SadlyNotSappho
it works but i uh. i got it to register by running it on windows yes, i set up a windows VM just to test my theory that for some fucked up reason, it hates linux and now another command just worked fine. ohKAY so if anyone is looking through this thread, trying to figure out how to fix this same problem, i have No Fucking Clue how to fix it. i just ran it in windows and it worked fine. and then running it in linux also worked.
SadlyNotSappho
oh well that's just lovely, i went back into the vm and found the logs, only to realize that it registered it globally
SadlyNotSappho
woooo! @Favna not sure if you've seen this, but yeah i have Absolutely No Idea what happened and i personally think that's funny
Favna
Favna2y ago
I also have no idea tbh