Description
Picnic is a simple framework for making discord bots. It uses Javascript for command and listener scripts. You can easily write and enable/reload scripts live.
Setup
Requirements
Build
- Clone this repo to your local machine using
https://github.com/Riku32/Picnic
- Build the executable
go build .
Usage
Configuration
The commands directory contains command modules. These modules are structured in a folder, each command must have it's own directory, the name does not matter. Each module must have a commands.js and prop.yaml
commands
└── test
├── command.js
└── prop.yaml
The prop.yaml file for each command must look like this
name: test
description: Just a testing command
category: general
alias: [t, info]
Runtime
The Picnic JS runtime is currently very simple and thus prone to change and not documented. A simple command module that works would be the one below
logger.info(args.author.id)
discord.sendMessage(args.channel.id, args.message.content)
There is no console class, it has been replaced with logger. The discord object is used for most discord detached library methods that do not depend on other data. The args object is passed in by default to each module and contains info about the command context.
The VM
The Javascript virtual machine that Picnic uses is only ES5.1 compatible by default. To allow ES6 to be usable enable es6 flag in the config.yaml file. This uses babel to compile your scripts into a readable format. This is extremely expiremental and error locations will not reflect the actual place they occur on the script you write.
Roadmap
- Javascript virtual machine
- Sending messages
- Attachables
- User object
- Message object
- Categories
- Command system
- Listener system