A message stored on a stack inside of the state object, used for tracking previously sent messages in channels.
||the id of the message|
||the id of the channel this message was sent in|
||the id of the author of this message|
A configuration object for determining how the State tracking behaves.
||Whether the state store should keep a buffer of previously sent messages. Message tracking allows for multiple higher-level shortcuts and can be highly useful when developing bots that need to delete their own messages. Message tracking is implemented using a deque and a namedtuple, meaning it should generally not have a high impact on memory, however users who find they do not need and may be experiencing memory pressure can disable this feature entirely using this attribute.|
||The size of the messages deque for each channel. This value can be used to calculate the total number of possible `StackMessage` objects kept in memory, simply: `total_messages_size * total_channels`. This value can be tweaked based on usage and to help prevent memory pressure.|
||If true, guilds will be automatically synced when they are initially loaded or joined. Generally this setting is OK for smaller bots, however bots in over 50 guilds will notice this operation can take a while to complete.|
The State class is used to track global state based on events emitted from
GatewayClient. State tracking is a core component of the Disco client,
providing the mechanism for most of the higher-level utility functions.
||A list of all events the State object binds to|
||The Client instance this state is attached to|
||The configuration for this state instance|
||The currently logged in user|
||Mapping of all known DM Channels|
||Mapping of all known/loaded Guilds|
||Weak mapping of all known/loaded Channels|
||Weak mapping of all known/loaded Users|
||Weak mapping of all known/active Voice States|
||Mapping of channel ids to deques containing `StackMessage` objects|
self, client, config)
Unbinds all bound event listeners for this state object.
Binds all events for this state object, storing the listeners for later