Webhook

data class Webhook(val data: WebhookData, val kord: Kord, val supplier: EntitySupplier = kord.defaultSupplier) : WebhookBehavior, Strategizable(source)

Constructors

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

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val id: Snowflake

The unique identifier of this entity.

Link copied to clipboard
open override val kord: Kord

The kord instance that created this object.

Link copied to clipboard
val name: String?
Link copied to clipboard
open override val supplier: EntitySupplier

The supplier used to request entities.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun compareTo(other: Entity): Int

Compares entities on id.

Link copied to clipboard
open suspend fun delete(reason: String? = null)

Requests to delete this webhook, this user must be the creator.

open suspend fun delete(token: String, reason: String? = null)

Requests to delete this webhook.

Link copied to clipboard
open suspend fun deleteMessage(token: String, messageId: Snowflake, threadId: Snowflake? = null)

Requests to delete the Message with the given messageId previously sent from this webhook using the token for authentication.

Link copied to clipboard
inline suspend fun WebhookBehavior.edit(builder: WebhookModifyBuilder.() -> Unit): Webhook

Requests to edit the webhook, this user must be the creator.

inline suspend fun WebhookBehavior.edit(token: String, builder: WebhookModifyBuilder.() -> Unit): Webhook

Requests to edit the webhook.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
inline suspend fun WebhookBehavior.execute(token: String, threadId: Snowflake? = null, builder: WebhookMessageCreateBuilder.() -> Unit): Message

Requests to execute this webhook.

Link copied to clipboard
inline suspend fun WebhookBehavior.executeIgnored(token: String, threadId: Snowflake? = null, builder: WebhookMessageCreateBuilder.() -> Unit)

Requests to execute this webhook.

Link copied to clipboard
suspend fun getChannel(): MessageChannel

Requests to get the channel this webhook operates in.

Link copied to clipboard

Requests to get the channel this webhook operates in, returns null if the TopGuildMessageChannel isn't present.

Link copied to clipboard
suspend fun getGuildOrNull(): Guild?

Requests to get the guild this webhook belongs to, returns null if the Guild isn't present.

Link copied to clipboard
open suspend fun getMessage(token: String, messageId: Snowflake, threadId: Snowflake? = null): Message

Requests the Message with the given messageId previously sent from this webhook using the token for authentication.

Link copied to clipboard
open suspend fun getMessageOrNull(token: String, messageId: Snowflake, threadId: Snowflake? = null): Message?

Requests the Message with the given messageId previously sent from this webhook using the token for authentication, returns null when the message isn't present.

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

Returns a new Webhook with the given strategy.