Package-level declarations

Functions

Link copied to clipboard
suspend fun CheckContext<*>.anyGuild()

Check asserting an Event was fired within a guild.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.channelAbove(builder: suspend (T) -> GuildChannelBehavior)

Check asserting that the channel an Event fired in is above the given channel in the channel list.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.channelBelow(builder: suspend (T) -> GuildChannelBehavior)

Check asserting that the channel an Event fired in is below the given channel in the channel list.

Link copied to clipboard
suspend fun channelFor(event: Event): ChannelBehavior?

Retrieves a channel that is the subject of a given event, if possible.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.channelHigherThan(id: Snowflake)

Check asserting that the channel an Event fired in is above the given channel in the channel list.

Link copied to clipboard
suspend fun CheckContext<*>.channelIsNsfw()

Check asserting that the channel an Event fired in is marked as NSFW.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.channelLowerThan(id: Snowflake)

Check asserting that the channel an Event fired in is below the given channel in the channel list.

Link copied to clipboard

Check asserting that the channel an Event fired in is marked as NSFW, or is in an NSFW guild.

Link copied to clipboard
suspend fun CheckContext<*>.channelType(vararg channelTypes: ChannelType)

Check asserting that the channel an Event fired in is of a given set of types.

Link copied to clipboard
inline fun KLogger.failed(reason: String)

Convenience wrapper for a "failing check" log message.

Link copied to clipboard
suspend fun guildFor(event: Event): GuildBehavior?

Retrieves a guild that is the subject of a given event, if possible.

Link copied to clipboard
suspend fun CheckContext<*>.guildNsfwLevelHigher(level: NsfwLevel)

Check asserting an Event was fired within a guild with a NSFW level higher than the provided one..

Link copied to clipboard
suspend fun CheckContext<*>.guildNsfwLevelHigherOrEqual(level: NsfwLevel)

Check asserting an Event was fired within a guild with a NSFW level higher than or equal to the provided one..

Link copied to clipboard
suspend fun CheckContext<*>.guildNsfwLevelLower(level: NsfwLevel)

Check asserting an Event was fired within a guild with a NSFW level lower than the provided one..

Link copied to clipboard
suspend fun CheckContext<*>.guildNsfwLevelLowerOrEqual(level: NsfwLevel)

Check asserting an Event was fired within a guild with a NSFW level lower than or equal to the provided one..

Link copied to clipboard
suspend fun CheckContext<*>.hasGuildNsfwLevel(level: NsfwLevel)

Check asserting an Event was fired within a guild with the given NSFW level.

Link copied to clipboard
suspend fun CheckContext<*>.hasPermission(perm: Permission)

Check asserting that the user an Event fired for has a given permission, or the Administrator permission.

Link copied to clipboard
suspend fun CheckContext<*>.hasPermissions(perms: Permissions)

Check asserting that the user an Event fired for has the given permissions set, or the Administrator permission.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.hasRole(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.hasRole(builder: suspend (T) -> RoleBehavior)

Check asserting that the user an Event fired for has a given role.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.inCategory(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.inCategory(builder: suspend (T) -> CategoryBehavior)

Check asserting that an Event fired within a given channel category.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.inChannel(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.inChannel(builder: suspend (T) -> ChannelBehavior)

Check asserting that an Event fired within a given channel.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.inGuild(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.inGuild(builder: suspend (T) -> GuildBehavior)

Check asserting that the guild an Event fired for is in a specific guild.

Link copied to clipboard
fun interactionFor(event: Event): Interaction?

Retrieves an interaction that is the subject of a given event, if possible.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.inTopChannel(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.inTopChannel(builder: suspend (T) -> ChannelBehavior)

Check asserting that an Event fired within a given channel. If the event fired within a thread, it checks the thread's parent channel instead.

Link copied to clipboard
suspend fun CheckContext<*>.isBot()

Check asserting the user for an Event is a bot. Will fail if the event doesn't concern a user.

Link copied to clipboard
suspend fun CheckContext<*>.isBotAdmin()

For bots owned by a team, check asserting the user for an Event is one of the bot's admins.

Link copied to clipboard
suspend fun CheckContext<*>.isBotOwner()

For bots with single owners, check asserting the user for an Event is the bot's owner.

Link copied to clipboard
suspend fun CheckContext<*>.isInThread()

Check asserting that the event was triggered within a thread.

Link copied to clipboard
suspend fun CheckContext<*>.isNotBot()

Check asserting the user for an Event is not a bot. Will pass if the event doesn't concern a user.

Link copied to clipboard
suspend fun CheckContext<*>.isNotBotAdmin()

For bots owned by a team, check asserting the user for an Event is not one of the bot's admins.

Link copied to clipboard
suspend fun CheckContext<*>.isNotBotOwner()

For bots with single owners, check asserting the user for an Event is not the bot's owner.

Link copied to clipboard
suspend fun CheckContext<*>.isNotInThread()

Check asserting that the event was not triggered within a thread, including events that don't concern any specific channel.

Link copied to clipboard
suspend fun memberFor(event: Event): MemberBehavior?

Retrieves a member that is the subject of a given event, if possible.

Link copied to clipboard
suspend fun messageFor(event: Event): MessageBehavior?

Retrieves a message that is the subject of a given event, if possible.

Link copied to clipboard
inline fun KLogger.noCategoryId(id: Snowflake)

Convenience wrapper for a "failing: no such category" log message.

Link copied to clipboard
inline fun KLogger.noChannelId(id: Snowflake)

Convenience wrapper for a "failing: no such channel" log message.

Link copied to clipboard
suspend fun CheckContext<*>.noGuild()

Check asserting an Event was not fired within a guild.

Link copied to clipboard
inline fun KLogger.noGuildId(id: Snowflake)

Convenience wrapper for a "failing: no such guild" log message.

Link copied to clipboard
inline fun KLogger.noRoleId(id: Snowflake)

Convenience wrapper for a "failing: no such role" log message.

Link copied to clipboard

Check asserting that the channel an Event fired in is not marked as NSFW.

Link copied to clipboard

Check asserting that the channel an Event fired in is not marked as NSFW, and is not in an NSFW guild.

Link copied to clipboard
suspend fun CheckContext<*>.notChannelType(vararg channelTypes: ChannelType)

Check asserting that the channel an Event fired in is not of a given set of types.

Link copied to clipboard
suspend fun CheckContext<*>.notHasGuildNsfwLevel(level: NsfwLevel)

Check asserting an Event was fired within a guild without the given NSFW level.

Link copied to clipboard
suspend fun CheckContext<*>.notHasPermission(perm: Permission)

Check asserting that the user an Event fired for does not have a given permission or the Administrator permission.

Link copied to clipboard
suspend fun CheckContext<*>.notHasPermissions(perms: Permissions)

Check asserting that the user an Event fired for does not have the given permissions set or the Administrator permission.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.notHasRole(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.notHasRole(builder: suspend (T) -> RoleBehavior)

Check asserting that the user an Event fired for does not have a given role.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.notInCategory(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.notInCategory(builder: suspend (T) -> CategoryBehavior)

Check asserting that an Event did not fire within a given channel category.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.notInChannel(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.notInChannel(builder: suspend (T) -> ChannelBehavior)

Check asserting that an Event did not fire within a given channel.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.notInGuild(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.notInGuild(builder: suspend (T) -> GuildBehavior)

Check asserting that the guild an Event fired for is not in a specific guild.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.notInTopChannel(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.notInTopChannel(builder: suspend (T) -> ChannelBehavior)

Check asserting that an Event did not fire within a given channel. If the event fired within a thread, it checks the thread's parent channel instead.

Link copied to clipboard
inline fun KLogger.nullChannel(event: Event)

Convenience wrapper for a "channel for event is null" log message.

Link copied to clipboard
inline fun KLogger.nullGuild(event: Event)

Convenience wrapper for a "guild for event is null" log message.

Link copied to clipboard
inline fun KLogger.nullMember(event: Event)

Convenience wrapper for a "member for event is null" log message.

Link copied to clipboard
inline fun KLogger.nullMessage(event: Event)

Convenience wrapper for a "message for event is null" log message.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.or(body: Check<T>)

Convenience function allowing you to pass this check context, if the checks provided in the body pass – even if the check context is failing.

Link copied to clipboard
inline fun KLogger.passed()
inline fun KLogger.passed(reason: String)

Convenience wrapper for a "passing check" log message.

Link copied to clipboard
fun roleFor(event: Event): RoleBehavior?

Retrieves a role that is the subject of a given event, if possible.

Link copied to clipboard

Silence the current check by removing any message it may have set.

Link copied to clipboard
suspend fun threadFor(event: Event): ThreadChannelBehavior?

Retrieves a thread that is the subject of a given event, if possible.

Link copied to clipboard
suspend fun topChannelFor(event: Event): ChannelBehavior?

Retrieves a channel that is the subject of a given event, if possible, returning the parent if the channel is a thread.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.topRoleEqual(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.topRoleEqual(builder: suspend (T) -> RoleBehavior)

Check asserting that the top role for the user an Event fired for is equal to a given role.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.topRoleHigher(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.topRoleHigher(builder: suspend (T) -> RoleBehavior)

Check asserting that the top role for the user an Event fired for is higher than a given role.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.topRoleHigherOrEqual(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.topRoleHigherOrEqual(builder: suspend (T) -> RoleBehavior)

Check asserting that the top role for the user an Event fired for is higher than or equal to a given

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.topRoleLower(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.topRoleLower(builder: suspend (T) -> RoleBehavior)

Check asserting that the top role for the user an Event fired for is lower than a given role.

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.topRoleLowerOrEqual(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.topRoleLowerOrEqual(builder: suspend (T) -> RoleBehavior)

Check asserting that the top role for the user an Event fired for is lower than or equal to a given

Link copied to clipboard
suspend fun <T : Event> CheckContext<T>.topRoleNotEqual(id: Snowflake)
suspend fun <T : Event> CheckContext<T>.topRoleNotEqual(builder: suspend (T) -> RoleBehavior)

Check asserting that the top role for the user an Event fired for is not equal to a given role.

Link copied to clipboard
suspend fun userFor(event: Event): UserBehavior?

Retrieves a user that is the subject of a given event, if possible.