Picnic command - github.com/Riku32/Picnic - Go Packages

Picnic

command module
v0.0.0-...-d3e3d86 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2020 License: MIT Imports: 8 Imported by: 0

README

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

  • Go 1.14
  • A computer

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
    • Sending embeds
  • Attachables
  • User object
  • Message object
  • Categories
  • Command system
    • Command arguments
  • Listener system

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
handler
stdlib
util

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL