#can not see slash command in other server

18 messages · Page 1 of 1 (latest)

heavy dune
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

marsh tundra
#

Show how you deploy your commands

tough lava
#
      body: commands,
    });

Here the code i use to register my command global

marsh tundra
#

Do you set any defaultMemberPermissions on them?

tough lava
marsh tundra
#

Are you sure the bot is invited into your friends server? Do you see it in the members list?

#

And are you sure your friend didn’t disable the commands after your bot first joined?

tough lava
#

here is it , it the bot2

#

here the thing , my friend who is the owner of his discord can see and use my bot's slash command , but me as the normal user can not see the slash command at all

#

and i dont know why that happen

marsh tundra
#

Then your friend did indeed set permissions (or you did indeed set defaultMemberPermissions on your commands)

tough lava
#

nah i dont set any default permission on my bot

#

my friend just give my bot a role that all

marsh tundra
#

Show how you define your command in your code please

tough lava
#
  data: new SlashCommandBuilder()
    .setName("something")
    .setDescription("st")
    .addStringOption((option) =>
      option
        .setName("st")
        .setDescription("st...")
        .setRequired(true)
    ),
  async execute(interaction) {
    const voiceChannel = interaction.member.voice.channel;
    const locales = {
      vi: "Bạn phải ở trong phòng voice để có thể sử dụng câu lệnh này",
      "en-US": "You must in a voice channel to use this slash command",
    };
    const member = interaction.member;
    if (!member.voice.channel) {
      interaction.reply(locales[interaction.locale]);
      return;
    }

    await interaction.deferReply();

    const connection = joinVoiceChannel({
      channelId: voiceChannel.id,
      guildId: voiceChannel.guild.id,
      adapterCreator: voiceChannel.guild.voiceAdapterCreator,
    });

    //my resource

    player.play(resource);

    player.on("error", (error) => {
      console.error(
        `Error player: ${error.message} with resource ${error.resource}`
      );
    });


  },
};```
Here my code
marsh tundra
#

Yeah, you apparently heavily redacted that..

tough lava
#

sr i need to do that

#

my resource is just my resource audio that all