Skip to content
SinisterRectus edited this page Mar 4, 2017 · 17 revisions

Enhanced Lua table that is used to store Discord objects of the same type.

Class Properties

Name Type Mutable Description
count number How many objects are cached

Class Methods

Prototype Interface Description
add(obj) Local Adds an object to the cache. Must match the defined type.
columns([keys[, ...]]) Local Returns a table of object keys in column-format, sorted by first key.
find(predicate) Local Returns the first object found that satisfies a predicate.
findAll(predicate) Local Returns an iterator for all objects that satisfy a predicate.
get([key,] value) Local Returns the first object that matches provided (key, value) pair.
getAll([key, value]) Local Returns an iterator for all objects that match the (key, value) pair.
has(obj) Local Returns a boolean indicating whether the cache contains the specified object.
iter() Local Returns an iterator for the objects in the queue. Order is not guaranteed.
merge(array) Local Adds many new Discord object from an array of data tables.
new(data) Local Adds a new Discord object from a data table and returns the object.
remove(obj) Local Remove an object from the cache. Must match the defined type.
rows([keys[, ...]]) Local Returns a table of object keys in row-format, sorted by first key.
Clone this wiki locally