hasRole

suspend fun <T : Event> CheckContext<T>.hasRole(builder: suspend (T) -> RoleBehavior)

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

Only events that can reasonably be associated with a guild member are supported. Please raise an issue if an event you expected to be supported, isn't.

Parameters

builder

Lambda returning the role to compare to.


suspend fun <T : Event> CheckContext<T>.hasRole(id: Snowflake)

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

Only events that can reasonably be associated with a guild member are supported. Please raise an issue if an event you expected to be supported, isn't.

Parameters

id

Role snowflake to compare to.