I have been trying to fix this issue for a while and cant find the right answer this is my code,
const { SlashCommandBuilder } = require("@discordjs/builders");
module.exports = {
data: new SlashCommandBuilder()
.setName('test')
.setDescription('Get info about a user or a server!')
.addStringOption(option =>
option.setName('category')
.setDescription('The gif category')
.setRequired(true)
.addChoices(
{ name: 'Funny', value: 'funny is funny' },
{ name: 'Meme', value: 'Meme is a meme' },
{ name: 'Movie', value: 'Movie is a Movie' },
))
,
async execute(interaction) {
interaction.options.getString('category');
}
}
Heres a pic of whats happening
I have been trying to fix this issue for a while and cant find the right answer this is my code,
const { SlashCommandBuilder } = require("@discordjs/builders");
module.exports = {
data: new SlashCommandBuilder()
.setName('test')
.setDescription('Get info about a user or a server!')
.addStringOption(option =>
option.setName('category')
.setDescription('The gif category')
.setRequired(true)
.addChoices(
{ name: 'Funny', value: 'funny is funny' },
{ name: 'Meme', value: 'Meme is a meme' },
{ name: 'Movie', value: 'Movie is a Movie' },
))
,
async execute(interaction) {
interaction.options.getString('category');
}
}
Heres a pic of whats happening
Share Improve this question edited Jun 11, 2022 at 0:09 Matthew M. 1,10711 silver badges18 bronze badges asked Jun 10, 2022 at 18:03 boss manboss man 711 silver badge2 bronze badges 3- I am also having this issue. It started when I added a string option to my slash mand, but was working perfectly fine before that – kaitlynmm569 Commented Sep 21, 2022 at 22:01
- Similar here, though I'm not sure what I did to break it. :( It's been hours now and has not fixed itself. – dreeves Commented May 8, 2023 at 11:37
- It should take at most an hour to sync. If it's been over an hour that sounds like a discord bug. – Glenn Willen Commented Oct 23, 2023 at 22:17
1 Answer
Reset to default 7I've seen this happen time to time. Discord takes some amount of time for slash mands to work their way into the system when you start up your code. If your code hits lots of guilds, it could take an hour. If you only specify one guild, it is usually fairly instant but in some cases it may take 5 min. Let your code run for 5-10 min and check back, it will probably fix this error.