@getsolara/solara.js
Version:
A lightweight and modular Discord bot framework built on discord.js v14, with truly optional feature packages.
4 lines • 569 B
JavaScript
module.exports = {
name: "$isNull", description: "Checks if variable value is null/undefined. Args: varName;[scope?]", takesBrackets: true,
execute: async (context, args) => { if (!args[0]) return "[Error: Requires varName]"; const varName = args[0]; const scope = args[1]?.toLowerCase() || 'local'; let value; if (scope === 'local') value = context.localVariables?.get(varName); else if (scope === 'global') value = context.client.variables?.get(varName); else return "[Error: Invalid scope]"; return (value === null || value === undefined).toString(); }
};