You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs_cache.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ Functions
23
23
get(key, value)
24
24
~~~~~~~~~~~~~~~
25
25
26
-
Returns a contained object where ``object[key] == value``. Returns the first object found that matches the criteria.
26
+
Returns a contained object where ``object[key] == value``. Also works if value is a regex or a function. Returns the first object found that matches the criteria.
Copy file name to clipboardExpand all lines: docs/docs_client.rst
+83-5Lines changed: 83 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,38 @@ This page contains documentation on the `Discord.Client` class. This should be u
9
9
10
10
--------
11
11
12
+
Parameters
13
+
----------
14
+
15
+
Client takes an options object, and supports the following properties.
16
+
17
+
forceFetchUsers
18
+
~~~~~~~~~~~~~~~
19
+
20
+
Make the library get all the users in all guilds, and delay the ready event until all users are received. This will slow down ready times and increase initial network traffic.
21
+
22
+
compress
23
+
~~~~~~~~
24
+
25
+
Have Discord send a compressed READY packet.
26
+
27
+
largeThreshold
28
+
~~~~~~~~~~~~~~
29
+
30
+
Set a custom large_threshold (the max number of offline members Discord sends in the initial GUILD_CREATE). The maximum is 250.
31
+
32
+
rateLimitAsError
33
+
~~~~~~~~~~~~~~~~
34
+
35
+
Have the lib throw a rejection Promise/callback when being ratelimited, instead of auto-retrying.
36
+
37
+
maxCachedMessages
38
+
~~~~~~~~~~~~~~~~~
39
+
40
+
The maximum number of messages to cache per channel. Decreasing this leads to more missing messageUpdated/messageDeleted events, increasing this leads to more RAM usage, especially over time
41
+
42
+
--------
43
+
12
44
Attributes
13
45
----------
14
46
@@ -32,10 +64,20 @@ servers
32
64
33
65
A Cache_ of Server_ objects that the client has cached.
34
66
67
+
unavailableServers
68
+
~~~~~~~~~~~~~~~~~~
69
+
70
+
A Cache_ of Server_ objects that the client has cached that are unavailable.
71
+
72
+
voiceConnections
73
+
~~~~~~~~~~~~~~~
74
+
75
+
A Cache_ of VoiceConnection_ objects that the client is in.
76
+
35
77
voiceConnection
36
78
~~~~~~~~~~~~~~~
37
79
38
-
A VoiceConnection_ object that is the current voice connection (if any).
80
+
Returns a VoiceConnection_ object, is an alias to voiceConnections[0].
39
81
40
82
readyTime
41
83
~~~~~~~~~
@@ -447,11 +489,12 @@ Joins a Voice Channel to begin transmitting audio
447
489
- **error** - error if any occurred
448
490
- **connection** - VoiceConnection_, the created Voice Connection.
449
491
450
-
leaveVoiceChannel(`callback`)
492
+
leaveVoiceChannel(channel, `callback`)
451
493
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
452
494
453
495
Leaves the currently connected Voice Channel if connected
454
496
497
+
- **channel** - A `VoiceChannel Resolvable`_
455
498
- **callback** - `function` that takes the following:
456
499
- **error** - error if any occurred
457
500
@@ -564,10 +607,45 @@ Overwrites the permissions of a role or a user in a channel
564
607
"attachFiles":true
565
608
}
566
609
567
-
forceFetchUsers()
568
-
~~~~~~~~~~~~~~~~~
610
+
muteMember(user, server, `callback`)
611
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
612
+
613
+
Server-mutes a member.
614
+
615
+
- **user** - A `User Resolvable`_ to mute
616
+
- **server** - A `Server Resolvable`_ to mute the user in
617
+
- **callback** - `function` taking the following:
618
+
- **error** - error if any occurred.
619
+
620
+
unmuteMember(user, server, `callback`)
621
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
622
+
623
+
Server-unmutes a member.
624
+
625
+
- **user** - A `User Resolvable`_ to unmute
626
+
- **server** - A `Server Resolvable`_ to unmute the user in
627
+
- **callback** - `function` taking the following:
628
+
- **error** - error if any occurred.
629
+
630
+
deafenMember(user, server, `callback`)
631
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
632
+
633
+
Server-deafens a member.
634
+
635
+
- **user** - A `User Resolvable`_ to deafen
636
+
- **server** - A `Server Resolvable`_ to deafen the user in
637
+
- **callback** - `function` taking the following:
638
+
- **error** - error if any occurred.
639
+
640
+
undeafenMember(user, server, `callback`)
641
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
569
642
570
-
As of 12/02/2016, the API will now only return the online users in a server if it has more than 250 users. If you want to be aware of ALL users in a server, use this function. As of yet, it doesn't return anything and users are just silently and gradually added to the relevant servers.
643
+
Server-undeafens a member.
644
+
645
+
- **user** - A `User Resolvable`_ to undeafen
646
+
- **server** - A `Server Resolvable`_ to undeafen the user in
0 commit comments