EntitySupplier

interface EntitySupplier

An abstraction that allows for requesting Discord entities.

See also

Functions

getActiveThreads
Link copied to clipboard
abstract fun getActiveThreads(guildId: Snowflake): Flow<ThreadChannel>
getApplicationCommandPermissions
Link copied to clipboard
open suspend fun getApplicationCommandPermissions(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake): ApplicationCommandPermissions
getApplicationCommandPermissionsOrNull
Link copied to clipboard
abstract suspend fun getApplicationCommandPermissionsOrNull(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake): ApplicationCommandPermissions?
getChannel
Link copied to clipboard
open suspend fun getChannel(id: Snowflake): Channel
Requests the Channel with the given id.
getChannelOrNull
Link copied to clipboard
abstract suspend fun getChannelOrNull(id: Snowflake): Channel?
Requests the Channel with the given id, returns null when the channel isn't present.
getChannelPins
Link copied to clipboard
abstract fun getChannelPins(channelId: Snowflake): Flow<Message>
Requests the pinned messages of the Channel with the given channelId.
getChannelWebhooks
Link copied to clipboard
abstract fun getChannelWebhooks(channelId: Snowflake): Flow<Webhook>
Requests the webhooks of the MessageChannel with the given channelId.
getCurrentUserGuilds
Link copied to clipboard
abstract fun getCurrentUserGuilds(limit: Int = Int.MAX_VALUE): Flow<Guild>
Requests the guild emojis of the Guild with the given guildId.
getEmoji
Link copied to clipboard
open suspend fun getEmoji(guildId: Snowflake, emojiId: Snowflake): GuildEmoji
Requests the GuildEmoji with the emojiId in the Guild wit the given guildId.
getEmojiOrNull
Link copied to clipboard
abstract suspend fun getEmojiOrNull(guildId: Snowflake, emojiId: Snowflake): GuildEmoji?
Requests the GuildEmoji with the emojiId in the Guild wit the given guildId, returns null when the emoji isn't present.
getEmojis
Link copied to clipboard
abstract fun getEmojis(guildId: Snowflake): Flow<GuildEmoji>
Requests the guild emojis of the Guild with the given guildId.
getGlobalApplicationCommand
Link copied to clipboard
open suspend fun getGlobalApplicationCommand(applicationId: Snowflake, commandId: Snowflake): GlobalApplicationCommand
getGlobalApplicationCommandOrNull
Link copied to clipboard
abstract suspend fun getGlobalApplicationCommandOrNull(applicationId: Snowflake, commandId: Snowflake): GlobalApplicationCommand?
getGlobalApplicationCommands
Link copied to clipboard
abstract fun getGlobalApplicationCommands(applicationId: Snowflake): Flow<GlobalApplicationCommand>
getGuild
Link copied to clipboard
open suspend fun getGuild(id: Snowflake): Guild
Requests the Guild with the given id.
getGuildApplicationCommand
Link copied to clipboard
open suspend fun getGuildApplicationCommand(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake): GuildApplicationCommand
getGuildApplicationCommandOrNull
Link copied to clipboard
abstract suspend fun getGuildApplicationCommandOrNull(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake): GuildApplicationCommand?
getGuildApplicationCommandPermissions
Link copied to clipboard
abstract fun getGuildApplicationCommandPermissions(applicationId: Snowflake, guildId: Snowflake): Flow<ApplicationCommandPermissions>
getGuildApplicationCommands
Link copied to clipboard
abstract fun getGuildApplicationCommands(applicationId: Snowflake, guildId: Snowflake): Flow<GuildApplicationCommand>
getGuildBan
Link copied to clipboard
open suspend fun getGuildBan(guildId: Snowflake, userId: Snowflake): Ban
Requests the Ban for the user the given userId in the Guild wit the given guildId, returns null when the ban isn't present.
getGuildBanOrNull
Link copied to clipboard
abstract suspend fun getGuildBanOrNull(guildId: Snowflake, userId: Snowflake): Ban?
Requests the Ban for the user the given userId in the Guild wit the given guildId, returns null when the ban isn't present.
getGuildBans
Link copied to clipboard
abstract fun getGuildBans(guildId: Snowflake): Flow<Ban>
Requests the bans of the Guild with the given guildId.
getGuildChannels
Link copied to clipboard
abstract fun getGuildChannels(guildId: Snowflake): Flow<TopGuildChannel>
Requests the channels of the Guild with the given guildId, channels with an Unknown type will be filtered out of the list.
getGuildMembers
Link copied to clipboard
abstract fun getGuildMembers(guildId: Snowflake, limit: Int = Int.MAX_VALUE): Flow<Member>
Requests the members of the Guild with the given guildId.
getGuildOrNull
Link copied to clipboard
abstract suspend fun getGuildOrNull(id: Snowflake): Guild?
Requests the Guild with the given id, returns null when the guild isn't present.
getGuildPreview
Link copied to clipboard
open suspend fun getGuildPreview(guildId: Snowflake): GuildPreview
getGuildPreviewOrNull
Link copied to clipboard
abstract suspend fun getGuildPreviewOrNull(guildId: Snowflake): GuildPreview?
getGuildRoles
Link copied to clipboard
abstract fun getGuildRoles(guildId: Snowflake): Flow<Role>
Requests the roles of the Guild with the given guildId.
getGuildVoiceRegions
Link copied to clipboard
abstract fun getGuildVoiceRegions(guildId: Snowflake): Flow<Region>
Requests the regions of the Guild with the given guildId.
getGuildWebhooks
Link copied to clipboard
abstract fun getGuildWebhooks(guildId: Snowflake): Flow<Webhook>
Requests the webhooks of the Guild with the given guildId.
getGuildWidget
Link copied to clipboard
open suspend fun getGuildWidget(guildId: Snowflake): GuildWidget
Requests to get the widget of this guildId.
getGuildWidgetOrNull
Link copied to clipboard
abstract suspend fun getGuildWidgetOrNull(guildId: Snowflake): GuildWidget?
Requests to get the widget of this guild through the strategy, returns null if the GuildWidget isn't present.
getJoinedPrivateArchivedThreads
Link copied to clipboard
abstract fun getJoinedPrivateArchivedThreads(channelId: Snowflake, before: Snowflake, limit: Int): Flow<ThreadChannel>
getMember
Link copied to clipboard
open suspend fun getMember(guildId: Snowflake, userId: Snowflake): Member
Requests the Member with the given userId in the Guild wit the given guildId.
getMemberOrNull
Link copied to clipboard
abstract suspend fun getMemberOrNull(guildId: Snowflake, userId: Snowflake): Member?
Requests the Member with the given userId in the Guild wit the given guildId, returns null when the member isn't present.
getMessage
Link copied to clipboard
open suspend fun getMessage(channelId: Snowflake, messageId: Snowflake): Message
Requests the Message with the given messageId in the MessageChannel with the given channelId.
getMessageOrNull
Link copied to clipboard
abstract suspend fun getMessageOrNull(channelId: Snowflake, messageId: Snowflake): Message?
Requests the Message with the given messageId in the MessageChannel with the given channelId, returns null when the message isn't present.
getMessagesAfter
Link copied to clipboard
abstract fun getMessagesAfter(messageId: Snowflake, channelId: Snowflake, limit: Int = Int.MAX_VALUE): Flow<Message>
Requests a flow of messages created after the Message with the messageId in the channel with the channelId.
getMessagesAround
Link copied to clipboard
abstract fun getMessagesAround(messageId: Snowflake, channelId: Snowflake, limit: Int = 100): Flow<Message>
Requests a flow of messages created around the Message with the messageId in the channel with the channelId.
getMessagesBefore
Link copied to clipboard
abstract fun getMessagesBefore(messageId: Snowflake, channelId: Snowflake, limit: Int = Int.MAX_VALUE): Flow<Message>
Requests a flow of messages created before the Message with the messageId in the channel with the channelId.
getPrivateArchivedThreads
Link copied to clipboard
abstract fun getPrivateArchivedThreads(channelId: Snowflake, before: Instant, limit: Int): Flow<ThreadChannel>
getPublicArchivedThreads
Link copied to clipboard
abstract fun getPublicArchivedThreads(channelId: Snowflake, before: Instant, limit: Int): Flow<ThreadChannel>
getRole
Link copied to clipboard
open suspend fun getRole(guildId: Snowflake, roleId: Snowflake): Role
Requests the Role with the given roleId in the Guild wit the given guildId.
getRoleOrNull
Link copied to clipboard
abstract suspend fun getRoleOrNull(guildId: Snowflake, roleId: Snowflake): Role?
Requests the Role with the given roleId in the Guild wit the given guildId, returns null when the role isn't present.
getSelf
Link copied to clipboard
open suspend fun getSelf(): User
Requests the User this bot represents.
getSelfOrNull
Link copied to clipboard
abstract suspend fun getSelfOrNull(): User?
Requests the User this bot represents, returns null when the user isn't present.
getStageInstance
Link copied to clipboard
open suspend fun getStageInstance(channelId: Snowflake): StageInstance
getStageInstanceOrNull
Link copied to clipboard
abstract suspend fun getStageInstanceOrNull(channelId: Snowflake): StageInstance?
getTemplate
Link copied to clipboard
open suspend fun getTemplate(code: String): Template
Requests the Template with the given code.
getTemplateOrNull
Link copied to clipboard
abstract suspend fun getTemplateOrNull(code: String): Template?
Requests the Template with the given code.
getTemplates
Link copied to clipboard
abstract fun getTemplates(guildId: Snowflake): Flow<Template>
getThreadMembers
Link copied to clipboard
abstract fun getThreadMembers(channelId: Snowflake): Flow<ThreadMember>
getUser
Link copied to clipboard
open suspend fun getUser(id: Snowflake): User
Requests the User with the given id.
getUserOrNull
Link copied to clipboard
abstract suspend fun getUserOrNull(id: Snowflake): User?
Requests the User with the given id, returns null when the user isn't present.
getWebhook
Link copied to clipboard
open suspend fun getWebhook(id: Snowflake): Webhook
Requests the Webhook with the given id.
getWebhookOrNull
Link copied to clipboard
abstract suspend fun getWebhookOrNull(id: Snowflake): Webhook?
Requests the Webhook with the given id, returns null when the webhook isn't present.
getWebhookWithToken
Link copied to clipboard
open suspend fun getWebhookWithToken(id: Snowflake, token: String): Webhook
Requests the Webhook with the given id using the token for authentication.
getWebhookWithTokenOrNull
Link copied to clipboard
abstract suspend fun getWebhookWithTokenOrNull(id: Snowflake, token: String): Webhook?
Requests the Webhook with the given id using the token for authentication, returns null when the webhook isn't present.

Properties

guilds
Link copied to clipboard
abstract val guilds: Flow<Guild>
Requests all guilds this bot is known to be part of.
regions
Link copied to clipboard
abstract val regions: Flow<Region>
Requests all regions known to this bot.

Inheritors

StoreEntitySupplier
Link copied to clipboard
CacheEntitySupplier
Link copied to clipboard
RestEntitySupplier
Link copied to clipboard

Extensions

getChannelOf
Link copied to clipboard
inline suspend fun <T : Channel> EntitySupplier.getChannelOf(id: Snowflake): T
Requests the Channel with the given id as type T.
getChannelOfOrNull
Link copied to clipboard
inline suspend fun <T : Channel> EntitySupplier.getChannelOfOrNull(id: Snowflake): T?
Requests the Channel with the given id as type T, returns null if the channel isn't present or if the channel is not of type T.
getGlobalApplicationCommandOf
Link copied to clipboard
inline suspend fun <T : GlobalApplicationCommand> EntitySupplier.getGlobalApplicationCommandOf(applicationId: Snowflake, id: Snowflake): T
Requests the GlobalApplicationCommand with the given id as type T.
getGlobalApplicationCommandOfOrNull
Link copied to clipboard
inline suspend fun <T : GlobalApplicationCommand> EntitySupplier.getGlobalApplicationCommandOfOrNull(applicationId: Snowflake, id: Snowflake): T?
Requests the GuildApplicationCommand with the given id as type T, returns null if the command application isn't present or if the channel is not of type T.
getGlobalApplicationOf
Link copied to clipboard
inline suspend fun <T : GlobalApplicationCommand> EntitySupplier.getGlobalApplicationOf(applicationId: Snowflake, id: Snowflake): T
Requests the GlobalApplicationCommand with the given id as type T.
getGlobalApplicationOfOrNull
Link copied to clipboard
inline suspend fun <T : GlobalApplicationCommand> EntitySupplier.getGlobalApplicationOfOrNull(applicationId: Snowflake, id: Snowflake): T?
Requests the GlobalApplicationCommand with the given id as type T, returns null if the command application isn't present or if the channel is not of type T.
getGuildApplicationCommandOf
Link copied to clipboard
inline suspend fun <T : GuildApplicationCommand> EntitySupplier.getGuildApplicationCommandOf(applicationId: Snowflake, guildId: Snowflake, id: Snowflake): T
Requests the GuildApplicationCommand with the given id as type T.
getGuildApplicationCommandOfOrNull
Link copied to clipboard
inline suspend fun <T : GuildApplicationCommand> EntitySupplier.getGuildApplicationCommandOfOrNull(applicationId: Snowflake, guildId: Snowflake, id: Snowflake): T?
Requests the GuildApplicationCommand with the given id as type T, returns null if the command application isn't present or if the channel is not of type T.
withFallback
Link copied to clipboard
infix fun EntitySupplier.withFallback(other: EntitySupplier): EntitySupplier
Creates supplier providing a strategy which will first operate on this supplier.

Sources

jvm source
Link copied to clipboard