Work In Progress
This documentation is in beta. It's missing lots of content, search is broken, and many links go nowhere. These problems will be fixed before release, but there's plenty of work left!
Skip to main content

Bundled Checks

Kord Extensions provides many built-in checks that you can use in all kinds of situations. To use them, call their functions as described on the basics page.

Channels

channelAbove

Checks whether the current event happened in a channel ordered above the given channel in the channel list. If the current event happened in a thread or the given channel is a thread, this check will use the threads' parent channels.

Note: This check doesn't make sure both channels are in the same guild.

Arguments
channelTypes:Snowflake() -> ChannelBehavior

Channel to check against, either in ID or builder form.

Events without Channels
For events without channels:
Normal

Always fails.

channelBelow

Checks whether the current event happened in a channel ordered below the given channel in the channel list. If the current event happened in a thread or the given channel is a thread, this check will use the threads' parent channels.

Note: This check doesn't make sure both channels are in the same guild.

Arguments
channelTypes:Snowflake() -> ChannelBehavior

Channel to check against, either in ID or builder form.

Events without Channels
For events without channels:
Normal

Always fails.

inCategory
notInCategory

Checks whether the current event happened in a channel within the given category. If the current event happened in a thread, this check will use the thread's parent channel.

Arguments
categoryTypes:Snowflake() -> CategoryBehavior

Category to check against, either in ID or builder form.

Events without Categories
For events without categories:
Normal

Always fails.

Negated

Always passes.

inTopChannel
notInTopChannel

Checks whether the current event happened in the given channel. If the current event happened in a thread, this check will use the thread's parent channel.

Arguments
channelTypes:Snowflake() -> ChannelBehavior

Channel to check against, either in ID or builder form.

Events without Channels
For events without channels:
Normal

Always fails.

Negated

Always passes.

Channel Types

channelType
notChannelType

Checks whether the current event happened in a channel matching the given channel types.

Arguments
channelTypesType: vararg ChannelType

Channel types to check.

Events without Channels
For events without channels:
Normal

Always fails.

Negated

Always passes.

Flat Checks

These checks don't resolve the parent channel if the event happened in a thread, which can be useful if you need to match a specific thread.

inChannel
notInChannel

Checks whether the current event happened in the given channel.

Note: If the current event happened in a thread, this check won't use the thread's parent channel. If you need this, use inTopChannel or notInTopChannel.

Arguments
channelTypes:Snowflake() -> ChannelBehavior

Channel to check against, either in ID or builder form.

Events without Channels
For events without channels:
Normal

Always fails.

Negated

Always passes.

Guilds

anyGuild
noGuild

Checks whether the current event happened in a guild.

Events without Guilds
For events without guilds:
Normal

Always fails.

Negated

Always passes.

inGuild
notInGuild

Checks whether the current event happened in the given guild.

Arguments
guildTypes:Snowflake() -> GuildBehavior

Guild to check against, either in ID or builder form.

Events without Guilds
For events without guilds:
Normal

Always fails.

Negated

Always passes.

Members

hasPermission
notHasPermission

Checks whether the member triggering the current event has either the given permission, or the admin permission.

Arguments
permType: Permission

Permission to check for.

Events without Members
For events without members:
Normal

Always fails.

Negated

Always passes.

hasPermissions
notHasPermissions

Checks whether the member triggering the current event has either the given permissions set, or the admin permission.

Arguments
permType: Permissions

Permissions to check for.

Events without Members
For events without members:
Normal

Always fails.

Negated

Always passes.

Misc

isBotOwner
isNotBotOwner

Checks whether the user triggering the current event is the bot's sole owner.

Notes
Normal

Fails if the bot is owned by a team.

Negated

Passes if the bot is owned by a team.

Events without Users
For events without users:
Normal

Always fails.

Negated

Always passes.

isBotAdmin
isNotBotAdmin

Checks whether the user triggering the current event belongs to the bot's owning team.

Notes
Normal

Fails if the bot isn't owned by a team, or the team has no admins.

Negated

Passes if the bot isn't owned by a team, or the team has no admins.

Events without Users
For events without users:
Normal

Always fails.

Negated

Always passes.

isBot
isNotBot

Checks whether the user triggering the current event is a bot.

Events without Users
For events without users:
Normal

Always fails.

Negated

Always passes.

isInThread
isNotInThread

Checks whether the current event happened in a thread.

Events without Channels
For events without channels:
Normal

Always fails.

Negated

Always passes.

NSFW

These checks use Kord's NsfwLevel type, which Kord Extensions customises to allow comparisons and translations (TODO).

hasGuildNsfwLevel
notHasGuildNsfwLevel

Checks whether the current event happened in a guild with the given NSFW level.

Events without Guilds
For events without guilds:
Normal

Always fails.

Negated

Always passes.

guildNsfwLevelHigher

Checks whether the current event happened in a guild with an NSFW level higher than the one provided.

Events without Guilds
For events without guilds:
Normal

Always fails.

guildNsfwLevelHigherorEqual

Checks whether the current event happened in a guild with an NSFW level higher than or equal to the one provided.

Events without Guilds
For events without guilds:
Normal

Always fails.

guildNsfwLevelLower

Checks whether the current event happened in a guild with an NSFW level lower than the one provided.

Events without Guilds
For events without guilds:
Normal

Always fails.

guildNsfwLevelLowerOrEqual

Checks whether the current event happened in a guild with an NSFW level lower than or equal to the one provided.

Events without Guilds
For events without guilds:
Normal

Always fails.

channelIsNsfw
notChannelIsNsfw

Checks whether the current event happened in an NSFW channel.

Events without Channels
For events without channels:
Normal

Always fails.

Negated

Always passes.

channelOrGuildIsNsfw
notChannelOrGuildIsNsfw

Checks whether the current event happened in an NSFW channel or guild.

Notes
Normal

Combines channelIsNsfw() and guildNsfwLevelHigherOrEqual(NsfwLevel.AgeRestricted).

Negated

Combines notChannelIsNsfw() and guildNsfwLevelLower(NsfwLevel.AgeRestricted).

Roles

hasRole
notHasRole

Checks whether the user triggering the current event has the given role.

Arguments
roleTypes:Snowflake() -> RoleBehavior

Role to check against, either in ID or builder form.

Events without Members
For events without members:
Normal

Always fails.

Negated

Always passes.

topRoleEqual
topRoleNotEqual

Checks whether the user triggering the current event has a top role matching the given role.

Arguments
roleTypes:Snowflake() -> RoleBehavior

Role to check against, either in ID or builder form.

Events without Members
For events without members:
Normal

Always fails.

Negated

Always passes.

topRoleHigher

Checks whether the user triggering the current event has a top role higher than the given role.

Arguments
roleTypes:Snowflake() -> RoleBehavior

Role to check against, either in ID or builder form.

Events without Members
For events without members:
Normal

Always fails.

topRoleHigherOrEqual

Checks whether the user triggering the current event has a top role higher than or equal to the given role.

Arguments
roleTypes:Snowflake() -> RoleBehavior

Role to check against, either in ID or builder form.

Events without Members
For events without members:
Normal

Always fails.

topRoleLower

Checks whether the user triggering the current event has a top role lower than the given role.

Arguments
roleTypes:Snowflake() -> RoleBehavior

Role to check against, either in ID or builder form.

Events without Members
For events without members:
Normal

Always fails.

topRoleLowerOrEqual

Checks whether the user triggering the current event has a top role lower than or equal to the given role.

Arguments
roleTypes:Snowflake() -> RoleBehavior

Role to check against, either in ID or builder form.

Events without Members
For events without members:
Normal

Always fails.