Closed AliAryanTech closed 2 years ago
export interface ICommand {
client?: WAClient;
handler?: MessageHandler;
run(
M: ISimplifiedMessage,
parsedArgs: IParsedArgs
): Promise<void | never> | void | never;
config: {
adminOnly?: boolean;
aliases?: string[];
description?: string;
command: string;
id?: string;
category?: TCategory;
usage?: string;
dm?: boolean;
baseXp?: number;
modsOnly?: boolean;
};
}
You can check it here
Just tell me how to make this command available for admins and mods both!! Like if there's a admin but it's not mod then he can use it also if there's a mod but not group admin he can also use that command
Just tell me how to make this command available for admins and mods both!! Like if there's a admin but it's not mod then he can use it also if there's a mod but not group admin he can also use that command
Unfortunately there isn't a config for that. But you can one like this -
if (!this.client.config.mods.includes(M.sender.jid) && !M.sender.isAdmin)
return void M.reply("You can't use this command")
I hope this clears your issue
Just tell me how to make this command available for admins and mods both!! Like if there's a admin but it's not mod then he can use it also if there's a mod but not group admin he can also use that command
Unfortunately there isn't a config for that. But you can one like this -
if (!this.client.config.mods.includes(M.sender.jid) && !M.sender.isAdmin) return void M.reply("You can't use this command")
I hope this clears your issue
You didn't tell me where I need to paste it So, it's possible I do a mistake
How to make a command available for admins and mods?? I don't know the syntax 🥲 I tried a lot but facing errors.... Can you tell me?
adminOnly: true || modsOnly: true,