#can not see slash command in other server
18 messages · Page 1 of 1 (latest)
Show how you deploy your commands
body: commands,
});
Here the code i use to register my command global
Do you set any defaultMemberPermissions on them?
nah i dont have any
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?
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
Then your friend did indeed set permissions (or you did indeed set defaultMemberPermissions on your commands)
nah i dont set any default permission on my bot
my friend just give my bot a role that all
Show how you define your command in your code please
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
Yeah, you apparently heavily redacted that..