mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
Added user docs
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
Client
|
Client
|
||||||
======
|
======
|
||||||
|
|
||||||
**extends EventEmitter_**
|
**extends** EventEmitter_
|
||||||
|
|
||||||
This page contains documentation on the `Discord.Client` class. This should be used when you want to start creating things with the API.
|
This page contains documentation on the `Discord.Client` class. This should be used when you want to start creating things with the API.
|
||||||
|
|
||||||
|
|||||||
71
docs/docs_user.rst
Normal file
71
docs/docs_user.rst
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
.. include:: ./vars.rst
|
||||||
|
|
||||||
|
User
|
||||||
|
====
|
||||||
|
|
||||||
|
**extends** Equality_
|
||||||
|
|
||||||
|
Stores information about users.
|
||||||
|
|
||||||
|
Attributes
|
||||||
|
----------
|
||||||
|
|
||||||
|
client
|
||||||
|
~~~~~~
|
||||||
|
|
||||||
|
The Client_ that created the user.
|
||||||
|
|
||||||
|
username
|
||||||
|
~~~~~~~~
|
||||||
|
|
||||||
|
`String`, username of the User.
|
||||||
|
|
||||||
|
discriminator
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
`Integer` from 0-9999, don't use this to identify users. Used to separate the user from the 9998 others that may have the same username. Made redundant by ``user.id``.
|
||||||
|
|
||||||
|
id
|
||||||
|
~~
|
||||||
|
|
||||||
|
`String` (do not parse to an Integer, will become inaccurate). The ID of a user, never changes.
|
||||||
|
|
||||||
|
avatar
|
||||||
|
~~~~~~
|
||||||
|
|
||||||
|
`String`, the ID/hash of a user's avatar. To get a path to their avatar, see ``user.avatarURL``.
|
||||||
|
|
||||||
|
status
|
||||||
|
~~~~~~
|
||||||
|
|
||||||
|
The status of a user, `String`. Either ``online``, ``offline`` or ``idle``.
|
||||||
|
|
||||||
|
gameID
|
||||||
|
~~~~~~
|
||||||
|
|
||||||
|
The ID of the game a user is playing, `Number`.
|
||||||
|
|
||||||
|
typing
|
||||||
|
~~~~~~
|
||||||
|
|
||||||
|
`Object` containing the following values;
|
||||||
|
|
||||||
|
.. code-block:: js
|
||||||
|
|
||||||
|
{
|
||||||
|
since : 1448038288519, //timestamp of when
|
||||||
|
channel : <Channel Object> // channel they are typing in.
|
||||||
|
}
|
||||||
|
|
||||||
|
avatarURL
|
||||||
|
~~~~~~~~~
|
||||||
|
|
||||||
|
A valid URL to the user's avatar if they have one, otherwise null.
|
||||||
|
|
||||||
|
Functions
|
||||||
|
---------
|
||||||
|
|
||||||
|
mention()
|
||||||
|
~~~~~~~~~
|
||||||
|
|
||||||
|
Returns a valid string that can be sent in a message to mention the user. By default, ``user.toString()`` does this so by adding a user object to a string, e.g. ``user + ""``, their mention code will be retrieved.
|
||||||
@@ -24,6 +24,7 @@ Contents:
|
|||||||
:caption: Documentation
|
:caption: Documentation
|
||||||
|
|
||||||
docs_client
|
docs_client
|
||||||
|
docs_user
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
.. _Client : ./docs_client.html
|
.. _Client : ./docs_client.html
|
||||||
.. _Cache : ./docs_cache.html
|
.. _Cache : ./docs_cache.html
|
||||||
|
.. _User : ./docs_user.html
|
||||||
.. _Promises : https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
.. _Promises : https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
||||||
.. _EventEmitter : https://nodejs.org/api/events.html#events_class_events_eventemitter
|
.. _EventEmitter : https://nodejs.org/api/events.html#events_class_events_eventemitter
|
||||||
Reference in New Issue
Block a user