how to make the command accessible only to the person with permission to manage messages

how to make the command accessible only to the person with permission to manage messages
12 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
./u.7-z
./u.7-zOP2y ago
i dint know
CanineData
CanineData2y ago
You can only set default member permissions admins will always be able to edit the perms Do you use builders?
d.js docs
d.js docs2y ago
method SlashCommandBuilder#setDefaultMemberPermissions() Sets the default permissions a member should have in order to run the command.
./u.7-z
./u.7-zOP2y ago
???
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
CanineData
CanineData2y ago
In your command files do you use builders or json
./u.7-z
./u.7-zOP2y ago
Please wait Eee I do not know
CanineData
CanineData2y ago
Show one of your command files
./u.7-z
./u.7-zOP2y ago
try {
const msg = message.replace(commandPrefix, '').replace(/ +/g, ' ').trim().split(' ', 2);

if (!msg[0]) {
setResponse(`Usage : \` ${commandPrefix} [#channel] [Message ID] \``);
} else {

if (!/^<#!?(\d{17,20})>$/.test(msg[0]))
throw new Error('Mention a valid channel!');

if (!/^\d{17,20}$/.test(msg[1]))
throw new Error('Provide a valid message ID!');

sendChannelMessage(channelId, 'Le message a et épingler !');

pinMessage(msg[0].match(/\d/g).join(''), msg[1]);
};
} catch (err) {
setResponse('Command Error : ` ' + err.message + ' `');
};
try {
const msg = message.replace(commandPrefix, '').replace(/ +/g, ' ').trim().split(' ', 2);

if (!msg[0]) {
setResponse(`Usage : \` ${commandPrefix} [#channel] [Message ID] \``);
} else {

if (!/^<#!?(\d{17,20})>$/.test(msg[0]))
throw new Error('Mention a valid channel!');

if (!/^\d{17,20}$/.test(msg[1]))
throw new Error('Provide a valid message ID!');

sendChannelMessage(channelId, 'Le message a et épingler !');

pinMessage(msg[0].match(/\d/g).join(''), msg[1]);
};
} catch (err) {
setResponse('Command Error : ` ' + err.message + ' `');
};
CanineData
CanineData2y ago
Oh your using message commands
./u.7-z
./u.7-zOP2y ago
How to make it so that only members who have the permission to manage messages can use it Hmm I believe I'm a beginner I would like to switch from bdfd to discord.js @caninedata
Want results from more Discord servers?
Add your server