From 9e0ed07160d7acc4b5293d58c43a0f842aa61c12 Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Sat, 26 Nov 2022 14:54:05 +0700 Subject: [PATCH] change `typeof variable === 'undefined'` to `!variable` --- commands/help.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/help.js b/commands/help.js index 7e5cb73..91f7977 100644 --- a/commands/help.js +++ b/commands/help.js @@ -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()