Skip to content

Instantly share code, notes, and snippets.

@YorkAARGH
YorkAARGH / app.js
Last active January 25, 2018 00:30
Simple, complete example of a bot in Discord.js
// Load up the discord.js library
const Discord = require("discord.js");
// This is your client. Some people call it `bot`, some people call it `self`,
// some might call it `cootchie`. Either way, when you see `client.something`, or `bot.something`,
// this is what we're refering to. Your client.
const client = new Discord.Client();
// Here we load the config.json file that contains our token and our prefix values.
const config = require("./config.json");

Argument Usage in Komada

Usage Structure

<> required argument, [] optional argument <Name:Type{min,max}>

  • Name Mostly used for debugging message, unless the type is Litteral in which it compares the argument to the name.
  • Type The type of variable you are expecting
  • Min, Max Minimum or Maximum for a giving variable (works on strings in terms of length, and on all types of numbers in terms of value) You are allowed to define any combination of min and max. Omit for none, {min} for min, {,max} for max.
  • Special Repeat Tag [...] will repeat the last usage optionally until you run out of arguments. Useful for doing something like <SearchTerm:str> [...] which will allow you to take as many search terms as you want, per your Usage Deliminator.