-
Notifications
You must be signed in to change notification settings - Fork 4
Classes
AdamJames edited this page Feb 25, 2017
·
8 revisions
An event-emitter base class.
Both on and once also accept an array containing event names instead of a single event.
-
on(event, callback, once)adds an event handler forevent. When triggered,callbackis called. -
once(event, callback)callsonwithonceset to true, which meanscallbackwill only be executed once. -
emit(name, data)dispatches an event calling any respective handler's callback withdata.
-
__handlersa table containing event handlers.
A storage class with various object-management functions. discriminator is optional and defaults to id.
-
add(object)adds an object if no object with samediscriminatoris found. -
remove(thing)removes an object,thingcan be an object or a string. -
getAll(key, value)returns a table containing all objects whereobject[key] == value. -
get(key, value)same as previous one but returning the first object found.
-
discriminatorstring defining what key is used for discrimination.
Used for REST requests.
-
basea string to be formatted off given arguments.
A REST management class.
-
request(route[, data, method])performs a request based on given values. -
routeaRouteobject. -
dataan object. -
methoda string representing what http method to use, defaults toGET.
A WebSocket management class.
-
send(opcode, data)formats and sends a Discord payload.
Last revision on 26 Feb. 2017 – satom99