Skip to content
AdamJames edited this page Feb 25, 2017 · 7 revisions

Methods

run()

Starts an infinite loop that processes all created clients.

edit({...})

Requires an object containing any of the following attributes.

  • username a string to be set as client's display name or setName(name).
  • avatar a base64 string or setAvatar(avatar).

setStatus({...})

Requires an object containing any of the following attributes.

  • game an object containing a name attribute or setGame(name)
  • idle a boolean indicating whether the client is to be shown as away or setIdle(bool)

createServer(name, region[, icon])

Creates a Guild and returns a Server structure representing newly created guild.

  • name a string representing new guild's name.
  • region a string representing desired voice region, usually obtained with getRegions.
  • icon a base64 string representing new guild's icon.

getRegions()

Returns an array containing valid guild voice regions.

acceptInvite(code)

Accepts a guild invite.

  • code a string representing an invite's unique code.

Attributes

settings

An object containing client's settings.

user

An User structure representing logged in client's user object.

users

A Cache object containing loaded users stored as User structures.

servers

A Cache object containing guilds the client is in stored as Server structures.

channels

A Cache object containing channels stored as Channel structures.

rest

A Rest object.

socket

A Socket object.

Clone this wiki locally