Worororo
Worororo
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Worororo on 6/13/2024 in #djs-questions
Channel permission check
so i am trying to find if bot have permission to send message in channel or not, i using this code
// Check if the bot has permission to send messages in the music channel
if (!interaction.guild.members.me.permissionsIn(musicChannel).has(PermissionsBitField.Flags.SendMessages)) {
return interaction.reply("I don't have permissions to send messages in that channel.").catch(err => {
client.error(err);
});
}
// Check if the bot has permission to send messages in the music channel
if (!interaction.guild.members.me.permissionsIn(musicChannel).has(PermissionsBitField.Flags.SendMessages)) {
return interaction.reply("I don't have permissions to send messages in that channel.").catch(err => {
client.error(err);
});
}
also i have this options enable
props = {
partials: [
Partials.Channel, // for text channel
Partials.GuildMember, // for guild member
Partials.User, // for discord user
],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMessages,
],
}
props = {
partials: [
Partials.Channel, // for text channel
Partials.GuildMember, // for guild member
Partials.User, // for discord user
],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMessages,
],
}
24 replies