#Getting client permissions
38 messages · Page 1 of 1 (latest)
what is command.userPerms?
it's an array of the permissions flags
for each command
I think i'm not accessing the client's permissions correctly
im not sure what the correct way is
can you please log and show it
yeah, console.log(command.userPerms)
it's just
"ADMINISTRATOR"
oh
I realized in my description it says userPerms
I meant to say botPerms
disregard userPerms
also, what is interaction? is this code callbacking after you execute a command?
can you try loggin interaction.guild.me?
I got a guild object
can you please show the full code
guild: <ref *1> Guild {
id: '964924694367174677',
name: 'Parallax Testing',
icon: '2085bcaf216ba49a4517efe29607e889',
features: [],
commands: GuildApplicationCommandManager {
permissions: [ApplicationCommandPermissionsManager],
guild: [Circular *1]
},
members: GuildMemberManager { guild: [Circular *1] },
channels: GuildChannelManager { guild: [Circular *1] },
bans: GuildBanManager { guild: [Circular *1] },
roles: RoleManager { guild: [Circular *1] },
presences: PresenceManager {},
voiceStates: VoiceStateManager { guild: [Circular *1] },
stageInstances: StageInstanceManager { guild: [Circular *1] },
invites: GuildInviteManager { guild: [Circular *1] },
scheduledEvents: GuildScheduledEventManager { guild: [Circular *1] },
available: true,
shardId: 0,
splash: null,
banner: null,
description: null,
verificationLevel: 'NONE',
vanityURLCode: null,
nsfwLevel: 'DEFAULT',
premiumSubscriptionCount: 0,
discoverySplash: null,
memberCount: 7,
large: false,
premiumProgressBarEnabled: false,
applicationId: null,
afkTimeout: 300,
afkChannelId: null,
systemChannelId: '964924694987948098',
premiumTier: 'NONE',
explicitContentFilter: 'DISABLED',
mfaLevel: 'NONE',
joinedTimestamp: 1655578962204,
defaultMessageNotifications: 'ALL_MESSAGES',
systemChannelFlags: SystemChannelFlags { bitfield: 0 },
maximumMembers: 500000,
maximumPresences: null,
approximateMemberCount: null,
approximatePresenceCount: null,
vanityURLUses: null,
rulesChannelId: null,
publicUpdatesChannelId: null,
preferredLocale: 'en-US',
ownerId: '310422534975782932',
emojis: GuildEmojiManager { guild: [Circular *1] },
stickers: GuildStickerManager { guild: [Circular *1] }
},
joinedTimestamp: 1655578962204,
premiumSinceTimestamp: null,
nickname: null,
pending: false,
communicationDisabledUntilTimestamp: null,
_roles: [ '987794504339816501' ],
user: ClientUser {
id: '730883332849532949',
bot: true,
system: false,
flags: UserFlags { bitfield: 0 },
username: 'Parallax Beta',
discriminator: '4311',
avatar: 'efd23f446c9e553b90cff17f41469995',
banner: undefined,
accentColor: undefined,
verified: true,
mfaEnabled: true
},
avatar: null
}```
i mean your code, not log
command.botPerms &&
!interaction.guild.me.permissions.has(command.botPerms) //check for client's permission
) {
return interaction.reply({
ephemeral: true,
embeds: [
new MessageEmbed()
.setColor(Embed.wrongcolor)
.setDescription(
`${
Emoji.Message.ERROR
} I don't have the required permissions to use this command\n \`${command.botPerms.join(
`, `
)}\``
)
.setFooter(`${Embed.footertext}`, client.user.displayAvatarURL()),
],
});
}```
do you have server members intent enabled on https://discord.com/developers/applications and at your Client object aswell? Intents.FLAGS.GUILD_MEMBERS