AbstractDeconstructingApplicationCommandRegistryStorage

Abstract class which can be used to implement a simple networked key-value based registry storage for ApplicationCommands.

For simplicity the parameter / return types of the abstract methods are all Strings.

Constructors

constructor()

Functions

Link copied to clipboard
open override fun constructUniqueIdentifier(data: T): String

Constructs a unique key for the given data.

Link copied to clipboard
open override fun entryFlow(): Flow<RegistryStorage.StorageEntry<Snowflake, T>>

Creates a flow of all entries in this registry.

Link copied to clipboard
open suspend override fun get(id: Snowflake): T?

Reads a value from the registry at the given key.

Link copied to clipboard
open suspend override fun register(data: T)

Lets the registry know about the specified type T, this may store the object in a local map, which is used for reconstructing later.

Link copied to clipboard
open suspend override fun remove(id: Snowflake): T?

Deletes a value from the registry with the given key.

Link copied to clipboard
open suspend override fun set(id: Snowflake, data: T)

Creates or updates an existing entry at the given unique key.