Class State
The State
class is used to track and maintain client
state.
Inherits from
-
Emitter
(base class)
Constructors
Name | Description |
---|---|
this
|
Fields
Name | Type | Description |
---|---|---|
api
|
APIClient |
|
client
|
Client |
|
gw
|
GatewayClient |
|
me
|
User |
Currently logged in user, recieved from READY payload. |
listeners
|
BoundEmitter[][string][EmitterOrder] |
Properties
Name | Type | Description |
---|---|---|
channels
[get]
|
ModelMap!(ulong,dscord.types.channel.Channel) |
ChannelMap of all tracked channels
|
guilds
[get]
|
ModelMap!(ulong,dscord.types.guild.Guild) |
GuildMap of all tracked guilds
|
users
[get]
|
ModelMap!(ulong,dscord.types.user.User) |
UserMap of all tracked users
|
Methods
Name | Description |
---|---|
setFeatures
|
Sets the state-tracking features
|
emit
|
Emit an event. |
listen
|
Listen to an event based on its type.
|
listenAll
|
Listen to all events. |
listenRaw
|
Listen to an event based on its name.
|
on
|
Listen to an event by string, ignoring the actual event in the callback.
|