StorageUnit
Class representing a storage unit. Storage units represent specific, single units of data, and explain how to store, retrieve and serialize that data.
Storage units instruct the data adapters, explaining exactly what needs to be done. However, those adapters are free to handle the storage as they feel they need to.
Properties
Channel context, supplied via withChannel or withChannelFrom.
Guild context, supplied via withGuild or withGuildFrom.
The identifier - usually a specific category or name. Represents a filename for file-backed storage.
Message context, supplied via withMessage or withMessageFrom.
Reference to the serializer for this storage unit's data type.
The type of data to store.
User context, supplied via withUser or withUserFrom.
Functions
Return a new StorageUnit object, containing a copy of all the data that's stored in this one.
Copy this StorageUnit, applying the given channel ID to its context, but only if it's not a DM channel.
Copy this StorageUnit, applying the given channel's ID to its context, but only if it's not a DM channel.
Copy this StorageUnit, applying the channel ID from the given event to its context, but only if it's present and not a DM channel.
Copy this StorageUnit, applying the given guild ID to its context.
Copy this StorageUnit, applying the given guild's ID to its context.
Copy this StorageUnit, applying the guild ID from the given event to its context, if present.
Copy this StorageUnit, applying the given message ID to its context.
Copy this StorageUnit, applying the given message's ID to its context.
Copy this StorageUnit, applying the message ID from the given event to its context, if present.
Copy this StorageUnit, applying the given user ID to its context.
Copy this StorageUnit, applying the given user's ID to its context.
Copy this StorageUnit, applying the user ID from the given event to its context, if present.