UNPKG

@getsolara/solara.js

Version:

A lightweight and modular Discord bot framework built on discord.js v14, with truly optional feature packages.

1 lines 541 B
module.exports = { name: "$typeOf", description: "Returns the internal JavaScript type of a value (from variable). 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 typeof value; } };