-
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,callback
is called. -
once(event, callback)
callson
withonce
set to true, which meanscallback
will only be executed once. -
emit(name, data)
dispatches an event calling any respective handler's callback withdata
.
-
__handlers
a 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 samediscriminator
is found. -
remove(thing)
removes an object,thing
can 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.
-
discriminator
string defining what key is used for discrimination.
Used for REST requests.
-
base
a string to be formatted off given arguments.
A REST management class.
-
request(route[, data, method])
performs a request based on given values. -
route
aRoute
object. -
data
an object. -
method
a 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