最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Discord commands 'This command is outdated, please try again in a few minutes' - Stack Overflow

programmeradmin2浏览0评论

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
Add a ment  | 

1 Answer 1

Reset to default 7

I'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.

发布评论

评论列表(0)

  1. 暂无评论