@getsolara/solara.js
Version:
A lightweight and modular Discord bot framework built on discord.js v14, with truly optional feature packages.
14 lines • 929 B
JavaScript
module.exports = {
name: "$listenEvent", description: "Listens for a custom event [Not Fully Implemented - Requires Setup]. Args: eventName;codeToRun", takesBrackets: true,
execute: async (context, args) => {
return "[Error: $listenEvent requires setup outside of command code. Define listeners in your main bot file.]";
/* Example conceptual setup in bot.js:
bot.customEvents.on('myCustomEvent', (data, triggerContext) => {
// Need to build a new context or reuse parts carefully
const newContext = { ...triggerContext, client: bot, localVariables: new Map(), embedData: {}, components: [], eventData: data };
const code = "$log[Event received! Data: $get[eventData].value]"; // Code to run from DB/config
bot.commandHandler.executeCode(code, newContext); // Need an executeCode method
});
*/
}
};