Skip to content

Instantly share code, notes, and snippets.

@Ovyerus

Ovyerus/clarisa.md

Last active May 10, 2019
Embed
What would you like to do?

Plans for Clarisa

  • Move to Erisa org and either keep name, or rename to @erisa/micro.
  • Essentially micro for bots.
  • Either single function export or programmatic instantiation.
    • Programmatic returns an instance of Erisa - still wraps single function.
  • Function export gets called with clarisa or @erisa/micro on the command line.
  • Ability to use command system without programmatic API
    • Either export as exports.commandSystem = true or config file?
    • Sets up a folder as a directory to load commands from.
    • Commands follow single function export like main.
    • Take name from filename (or function if it's named?)
    • Add props to function fn.foo = 'bar' for extras, or object?
import {send, MainFunction} from 'clarisa'; // or whatever name we end up on.

export const token = 'token';

export default async msg => {
    if (msg.content === '!ping')
        return 'Pong!';  // Can return a string for simpole replies.
    else if (msg.content === '!pong')
        return /* await */ send({
            description
        });  // Function for more advanced sending (embeds, images).
             // Should we make it return something, or have it take in msg as an argument and then return the sent message?
             // (ie. msg.createMessage)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.