prevent limited test commands from showing outside

of limited tests
This commit is contained in:
derpystuff 2023-10-29 20:15:25 +01:00
parent 54c351c1a3
commit 9bb2e00ee8
2 changed files with 5 additions and 3 deletions

View file

@ -116,6 +116,8 @@ module.exports = {
permissionsClient: [Permissions.EMBED_LINKS, Permissions.SEND_MESSAGES, Permissions.USE_EXTERNAL_EMOJIS, Permissions.READ_MESSAGE_HISTORY],
run: async (context, args) => {
if(canUseLimitedTestCommands(context)) categories["limited"] = `${icon("stars")} Limited Test Commands`;
else if(categories["limited"]) delete categories["limited"]
if(args.command){
await context.triggerTyping()
// Detailed command view

View file

@ -23,9 +23,9 @@ function isLimitedTestUser(user){
}
function canUseLimitedTestCommands(context){
if(LIMITED_TEST_GUILDS && LIMITED_TEST_GUILDS.includes(context.guild.id)) return true;
if(LIMITED_TEST_CHANNELS && LIMITED_TEST_CHANNELS.includes(context.channel.id)) return true;
if(LIMITED_TEST_USERS && LIMITED_TEST_USERS.includes(context.user.id)) return true;
if(isLimitedTestGuild(context.guild)) return true;
if(isLimitedTestChannel(context.channel)) return true;
if(isLimitedTestUser(context.user)) return true;
return false;
}