ChannelArg

open class ChannelArg<T : GuildChannel>(    val name: String = "Channel",     val description: String = internalLocale.channelArgDescription,     allowsGlobal: Boolean = false) : ChannelArgument<T>

Accepts a Discord TextChannel entity as an ID or mention.

Parameters

allowsGlobal

Whether this entity can be retrieved from outside this guild.

Constructors

Link copied to clipboard
fun ChannelArg(    name: String = "Channel",     description: String = internalLocale.channelArgDescription,     allowsGlobal: Boolean = false)

Types

Link copied to clipboard
object Companion : ChannelArg<TextChannel>

Accepts a Discord TextChannel entity as an ID or mention from within this guild.

Functions

Link copied to clipboard
open suspend override fun generateExamples(context: DiscordContext): List<String>

A function called whenever an example of this type is needed.

Link copied to clipboard
open fun isOptional(): Boolean

Utility function to check that this Argument is an OptionalArg.

Link copied to clipboard
open fun multiple(): MultipleArg<Channel, T>

Accept multiple inputs of this Argument.

Link copied to clipboard
open fun optional(default: T): OptionalArg<Channel, T, T>

Make this argument optional and fall back to the default value if the conversion fails.

open fun optional(default: suspend (DiscordContext) -> T): OptionalArg<Channel, T, T>

Make this argument optional and fall back to the default value if the conversion fails. Exposes a CommandEvent.

Link copied to clipboard
open fun optionalNullable(default: T? = null): OptionalArg<Channel, T, T?>

Make this argument optional and fall back to the default value if the conversion fails.

open fun optionalNullable(default: suspend (DiscordContext) -> T?): OptionalArg<Channel, T, T?>

Make this argument optional and fall back to the default value if the conversion fails. Exposes a CommandEvent.

Link copied to clipboard
open suspend override fun parse(args: MutableList<String>, discord: Discord): Channel?

Parse string input into the correct type handled by this argument.

Link copied to clipboard
open suspend override fun transform(input: Channel, context: DiscordContext): Result<T>

Transforms a value produced by a slash command or by the parse function.

Properties

Link copied to clipboard
open override val description: String

A description of the data that this type represents.

Link copied to clipboard
open override val name: String

The display name for this type in documentations and examples.

Inheritors

Link copied to clipboard