Ban

class Ban(val data: BanData, val kord: Kord, val supplier: EntitySupplier = kord.defaultSupplier) : KordObject, Strategizable(source)

An instance of a Discord Ban.

Constructors

Link copied to clipboard
constructor(data: BanData, kord: Kord, supplier: EntitySupplier = kord.defaultSupplier)

Properties

Link copied to clipboard
Link copied to clipboard
open override val kord: Kord

The kord instance that created this object.

Link copied to clipboard

The reason for the ban, if present.

Link copied to clipboard
open override val supplier: EntitySupplier

The supplier used to request entities.

Link copied to clipboard

The behavior of the banned user.

Link copied to clipboard

The id of the banned user.

Functions

Link copied to clipboard
suspend fun getUser(): User

Requests to get the User that was banned.

Link copied to clipboard
suspend fun getUserOrNull(): User?

Requests to get the User that was banned, returns null if the User isn't present.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun withStrategy(strategy: EntitySupplyStrategy<*>): Ban

Returns a new Ban with the given strategy.