Documentation

Login

Type Definitions +

TypeDefinition
messageContent string or an object representing rich content (text, embeds, attachments).
embedData Object with optional fields for creating an embed:
{ title?: string, description?: string, color?: number, fields?: Array<{name: string, value: string, inline?: boolean}>, footer?: {text: string}, image?: {url: string}, thumbnail?: {url: string}, author?: {name: string, icon_url?: string}, url?: string }
argType One of the predefined argument types: string, number, boolean, User, Member, Role.
transData Object that is usually passed into lang.translate():
{ en: string, ru: string }

Libraries +

DB Library

Max 30 calls per command. Keys ≤ 512 B, Values ≤ 16 KB (number, string, boolean).

FunctionArgumentsReturns
db.setkey: string, value: number|string|booleannone

Sets a value in the database. Overwrites any existing value for the same key.

FunctionArgumentsReturns
db.getkey: stringnumber|string|boolean|null

Retrieves the value for a key. Returns null if the key does not exist.

FunctionArgumentsReturns
db.removekey: stringnone

Removes a key-value pair from the database.

Mem Library

Similar to DB library, but data is temporary and cleared on restart.

FunctionArgumentsReturns
mem.setkey: string, value: number|string|booleannone

Stores a temporary value in memory for the session.

FunctionArgumentsReturns
mem.getkey: stringnumber|string|boolean|null

Retrieves a value from memory. Returns null if not found.

FunctionArgumentsReturns
mem.removekey: stringnone

Deletes a key-value pair from memory.

Utils Library

FunctionArgumentsReturns
utils.getRolenameOrId: stringrole object|null

Finds a role by name or ID in the current guild.

FunctionArgumentsReturns
utils.hasRolememberLike: string, roleId: stringboolean

Checks if a member has a specific role.

FunctionArgumentsReturns
utils.addRolesmemberId: string, roleIds: [string]none

Adds specified roles for member.

FunctionArgumentsReturns
utils.removeRolesmemberId: string, roleIds: [string]none

Removes specified roles from member.

FunctionArgumentsReturns
utils.getMembernameOrId: stringmember object|null

Finds a guild member by username or ID.

FunctionArgumentsReturns
utils.randmin: number, max: numbernumber

Generates a random number between min and max (inclusive).

Embed Library

FunctionArgumentsReturns
embed.newdata: embedDataembed object

Creates a new embed object based on the given embedData.

Argument Library

FunctionArgumentsReturns
arg.getindex: numberstring

Returns the argument at the given index as a string.

FunctionArgumentsReturns
arg.getTypeindex: number, type: argTypeany

Returns the argument at the given index cast to the specified type.

FunctionArgumentsReturns
arg.getAll()Array<string>

Returns all arguments as an array of strings.

Language Library

FunctionArgumentsReturns
lang.getLocaleuserId: number?string

Returns locale of the given user. Defaults to the userId of the command caller.

FunctionArgumentsReturns
lang.translateval: transData, locale: string?string

Picks one of the options in transData from given locale. Defaults to the locale of the command caller.

Message Helpers +

FunctionArgumentsReturns
sendcontent: string | messageContentmessageId

Sends a message in the current channel.

FunctionArgumentsReturns
editmessageId: string, content: string | messageContentmessageId

Edits an existing message by ID.

FunctionArgumentsReturns
sendTochannelId: string, content: string | messageContentmessageId

Sends a message to a specific channel by ID.

FunctionArgumentsReturns
message.replycontent: string | messageContentnone

Replies to the message that triggered the command.

FunctionArgumentsReturns
message.delete-none

Deletes the current message.

FunctionArgumentsReturns
message.reactemoji: stringnone

Adds a reaction emoji to the current message.

Message Objects +

Author

Information about the user who sent the message.

Fields: id, username, discriminator, tag, bot.

Member

Represents the guild member who sent the message.

Fields: id, nickname, roles, permissions, botRole.

Guild

Information about the guild (server).

Fields: id, name, ownerId.

Channel

Information about the channel where the message was sent.

Fields: id, name, type.

Message

Represents the message itself.

Fields: id, content, createdTimestamp, editedTimestamp, attachments, embeds.

Date Library +

FunctionArgumentsReturns
Date.new()Date object

Returns the Date object.

FunctionArgumentsReturns
Date.now()number

Returns the current timestamp in milliseconds since Unix epoch.

FunctionArgumentsReturns
Date.parseval: stringnumber

Parses a date string and returns the timestamp in milliseconds.

JSON Library +

FunctionArgumentsReturns
JSON.stringifyval: anystring

Converts a value (object, array, etc.) to a JSON string.

FunctionArgumentsReturns
JSON.parseval: stringany

Parses a JSON string into a JavaScript object or value.

Math Library +

Math constants: Math.PI, Math.LN2, Math.LN10, Math.LOG2E, Math.LOG10E, Math.SQRT1_2, Math.SQRT2, Math.E

Math functions: abs, acos, acosh, asin, atan, atan2, atanh, cbrt, ceil, clz32, cos, cosh, exp, expm1, floor, f16round, fround, hypot, imul, log, log10, log1p, log2, max, min, pow, random, round, sign, sin, sinh, sqrt, sumPrecise, tan, tanh, trunc.

Utility Functions +

FunctionArgumentsReturns
sleepseconds: numbernone

Pauses execution for the specified number of seconds.

FunctionArgumentsReturns
toStringvalue: anystring

Converts any value to a string.

FunctionArgumentsReturns
toNumbervalue: stringnumber

Converts a string to a number. Returns NaN if conversion fails.

FunctionArgumentsReturns
typeofvalue: anystring

Returns the type of a value as a string (e.g., "string", "number", "boolean").