ChatCommandSource

class ChatCommandSource(event: MessageCreateEvent, command: String, prefixUsed: String, scope: CoroutineScope) : CoroutineScope

Command source for chat commands. Provides easy access to the message event objects.

Constructors

ChatCommandSource
Link copied to clipboard
fun ChatCommandSource(event: MessageCreateEvent, command: String, prefixUsed: String, scope: CoroutineScope)

Functions

equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
getChannel
Link copied to clipboard
suspend fun getChannel(): MessageChannel
getGuild
Link copied to clipboard
suspend fun getGuild(): Guild
getGuildChannel
Link copied to clipboard
suspend fun getGuildChannel(): GuildMessageChannel
hashCode
Link copied to clipboard
open override fun hashCode(): Int

Properties

client
Link copied to clipboard
val client: GatewayDiscordClient
command
Link copied to clipboard
val command: String
coroutineContext
Link copied to clipboard
open override val coroutineContext: CoroutineContext
event
Link copied to clipboard
val event: MessageCreateEvent
guildId
Link copied to clipboard
val guildId: Snowflake?
member
Link copied to clipboard
val member: Member
message
Link copied to clipboard
val message: Message
prefixUsed
Link copied to clipboard
val prefixUsed: String
user
Link copied to clipboard
val user: User

Extensions

respondEmbed
Link copied to clipboard
suspend fun ChatCommandSource.respondEmbed(builder: EmbedBuilder.() -> Unit): Message

Builds an EmbedCreateSpec and sends it in the channel that the command was invoked in.

suspend fun ChatCommandSource.respondEmbed(spec: EmbedCreateSpec): Message

Sends an embed based on the EmbedCreateSpec in the channel that the command was invoked in.

respondMessage
Link copied to clipboard
suspend fun ChatCommandSource.respondMessage(content: String): Message

Builds a message spec with only content and sends it in the channel the command was invoked in.

suspend fun ChatCommandSource.respondMessage(builder: MessageBuilder.() -> Unit): Message

Builds a MessageCreateSpec and sends it in the channel that the command was invoked in.

suspend fun ChatCommandSource.respondMessage(template: MessageCreateSpec): Message

Sends a message based on the MessageCreateSpec in the channel that the command was invoked in.

suspend fun ChatCommandSource.respondMessage(vararg specs: EmbedCreateSpec): Message

Sends an embed based on the EmbedCreateSpec in the channel that the command was invoked in.

Sources

jvm source
Link copied to clipboard