change typeof variable === 'undefined' to !variable

This commit is contained in:
ChomeNS 2022-11-26 14:54:05 +07:00
parent 9e4dc24b4a
commit 9e0ed07160

View file

@ -9,7 +9,7 @@ module.exports = {
usage: '[command]',
trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) {
if (typeof args[0] !== 'undefined') {
if (args[0]) {
for (const command of bot.command_handler.commands) {
function run() {
let alias = command.name;
@ -98,7 +98,7 @@ module.exports = {
}
},
discordExecute: async function(bot, username, usernameraw, sender, prefix, args, channeldc) {
if (typeof args[0] !== 'undefined') {
if (args[0]) {
for (const command of bot.command_handler.commands) {
function run() {
let alias = command.name;
@ -125,11 +125,11 @@ module.exports = {
let supportedCommands = '';
let unsupportedCommands = '';
for (const command of bot.command_handler.commands) {
if (typeof command.discordExecute === 'undefined') continue;
if (!command.discordExecute) continue;
supportedCommands += command.name + ' ';
}
for (const command of bot.command_handler.commands) {
if (typeof command.discordExecute !== 'undefined') continue;
if (!command.discordExecute) continue;
unsupportedCommands += command.name + ' ';
}
const Embed = new MessageEmbed()