Miscellaneous
There are many useful functions that can be used in many places to avoid duplicating code, you can see a list here :
Errors
argError : Send an argument error.
codeError : Send an internal error.
permissionsError : Send a permission error.
Arguments
getThing : Get easily arguments of a given type.
JSON Utilities
saveJSON : Saves a JSON safely, returning a boolean meaning if it worked.
readJSON : Reads a JSON, prefer using
import
orrequire
.
Permissions
isOwner : Returns
true
if the given ID is included in the owners set inCommandHandler.create
.isPermission : Returns
true
if the given string is a valid permission. It's also a type guard forPermissionString
type for TypeScript users.
Other
cutIfTooLong : Cut a text at a given length (if too long).
getKeyByValue : Get a key from a value in an object.
random : Returns a random value from an array.
Last updated