mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Finalised attributes on docs
This commit is contained in:
@@ -35,17 +35,73 @@ An `Integer` representing what state of connection the Client is in.
|
||||
- **3** is ready, meaning the Client is ready to begin listening.
|
||||
- **4** is disconnected, meaning the Client was disconnected due to any reason.
|
||||
|
||||
See also ready_.
|
||||
|
||||
.. code-block:: js
|
||||
|
||||
if( bot.state === 3 ) // ready to go
|
||||
|
||||
user
|
||||
~~~~
|
||||
A `User`_ object representing the user of the signed in client.
|
||||
A `User`_ object representing the account of the signed in client. This will only be available when the client is in the ready state (3).
|
||||
|
||||
.. code-block:: js
|
||||
|
||||
bot.user.username; // username of the account logged in
|
||||
|
||||
email
|
||||
~~~~~
|
||||
A `String` that is the email used to sign the client in.
|
||||
|
||||
password
|
||||
~~~~~~~~
|
||||
A `String` that is the password used to sign the client in.
|
||||
|
||||
readyTime
|
||||
~~~~~~~~~
|
||||
A `Number` representing the unix timestamp from when the client was ready. `Null` if not yet ready.
|
||||
|
||||
.. code-block:: js
|
||||
|
||||
bot.readyTime; // 1443378242464
|
||||
|
||||
uptime
|
||||
~~~~~~
|
||||
A `Number` representing how many milliseconds have passed since the client was ready. `Null` if not yet ready.
|
||||
|
||||
.. code-block:: js
|
||||
|
||||
if( bot.uptime > 5000 ) // true if the client has been up for more than 5 seconds
|
||||
|
||||
ready
|
||||
~~~~~
|
||||
A `Boolean` that is true if the client is ready. A shortcut to checking if ``bot.state === 3``.
|
||||
|
||||
servers
|
||||
~~~~~~~
|
||||
An `Array` of Server_ objects that the client has access to. Represents the servers the client is in.
|
||||
|
||||
channels
|
||||
~~~~~~~~
|
||||
An `Array` of Channel_ objects that the client has access to. Represents the channels the client can access.
|
||||
|
||||
users
|
||||
~~~~~
|
||||
An `Array` of User_ objects that the client has access to.
|
||||
|
||||
PMChannels
|
||||
~~~~~~~~~~
|
||||
An `Array` of PMChannel_ objects the client has access to.
|
||||
|
||||
messages
|
||||
~~~~~~~~
|
||||
An `Array` of Message_ objects the client has received over its uptime.
|
||||
|
||||
Functions
|
||||
---------
|
||||
|
||||
.. _User : #user
|
||||
.. _User : #user
|
||||
.. _ready : #ready
|
||||
.. _Server : #server
|
||||
.. _Channel : #channel
|
||||
.. _Message : #message
|
||||
Reference in New Issue
Block a user