Safe Haskell | None |
---|---|
Language | Haskell2010 |
Discord.Internal.Types.ApplicationCommands
Synopsis
- data ApplicationCommand
- = ApplicationCommandUser { }
- | ApplicationCommandMessage { }
- | ApplicationCommandChatInput {
- applicationCommandId :: ApplicationCommandId
- applicationCommandApplicationId :: ApplicationId
- applicationCommandGuildId :: Maybe GuildId
- applicationCommandName :: Text
- applicationCommandDescription :: Text
- applicationCommandOptions :: Maybe Options
- applicationCommandDefaultPermission :: Bool
- applicationCommandVersion :: Snowflake
- data Options
- data OptionSubcommandOrGroup
- data OptionSubcommand = OptionSubcommand {}
- data OptionValue
- = OptionValueString {
- optionValueName :: Text
- optionValueDescription :: Text
- optionValueRequired :: Bool
- optionValueStringChoices :: AutocompleteOrChoice Text
- | OptionValueInteger {
- optionValueName :: Text
- optionValueDescription :: Text
- optionValueRequired :: Bool
- optionValueIntegerChoices :: AutocompleteOrChoice Integer
- optionValueIntegerMinVal :: Maybe Integer
- optionValueIntegerMaxVal :: Maybe Integer
- | OptionValueBoolean { }
- | OptionValueUser { }
- | OptionValueChannel { }
- | OptionValueRole { }
- | OptionValueMentionable { }
- | OptionValueNumber {
- optionValueName :: Text
- optionValueDescription :: Text
- optionValueRequired :: Bool
- optionValueNumberChoices :: AutocompleteOrChoice Number
- optionValueNumberMinVal :: Maybe Number
- optionValueNumberMaxVal :: Maybe Number
- = OptionValueString {
- createChatInput :: Text -> Text -> Maybe CreateApplicationCommand
- createUser :: Text -> Maybe CreateApplicationCommand
- createMessage :: Text -> Maybe CreateApplicationCommand
- data CreateApplicationCommand
- data EditApplicationCommand
- defaultEditApplicationCommand :: Int -> EditApplicationCommand
- data Choice a = Choice {
- choiceName :: Text
- choiceValue :: a
- data ApplicationCommandChannelType
- = ApplicationCommandChannelTypeGuildText
- | ApplicationCommandChannelTypeDM
- | ApplicationCommandChannelTypeGuildVoice
- | ApplicationCommandChannelTypeGroupDM
- | ApplicationCommandChannelTypeGuildCategory
- | ApplicationCommandChannelTypeGuildNews
- | ApplicationCommandChannelTypeGuildStore
- | ApplicationCommandChannelTypeGuildNewsThread
- | ApplicationCommandChannelTypeGuildPublicThread
- | ApplicationCommandChannelTypeGuildPrivateThread
- | ApplicationCommandChannelTypeGuildStageVoice
- data GuildApplicationCommandPermissions = GuildApplicationCommandPermissions {}
- data ApplicationCommandPermissions = ApplicationCommandPermissions {}
- type Number = Scientific
Documentation
data ApplicationCommand Source #
The structure for an application command.
Constructors
ApplicationCommandUser | |
Fields
| |
ApplicationCommandMessage | |
Fields
| |
ApplicationCommandChatInput | |
Fields
|
Instances
Eq ApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods (==) :: ApplicationCommand -> ApplicationCommand -> Bool # (/=) :: ApplicationCommand -> ApplicationCommand -> Bool # | |
Read ApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods readsPrec :: Int -> ReadS ApplicationCommand # readList :: ReadS [ApplicationCommand] # | |
Show ApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods showsPrec :: Int -> ApplicationCommand -> ShowS # show :: ApplicationCommand -> String # showList :: [ApplicationCommand] -> ShowS # | |
FromJSON ApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods parseJSON :: Value -> Parser ApplicationCommand # parseJSONList :: Value -> Parser [ApplicationCommand] # |
Either subcommands and groups, or values.
Constructors
OptionsSubcommands [OptionSubcommandOrGroup] | |
OptionsValues [OptionValue] |
data OptionSubcommandOrGroup Source #
Either a subcommand group or a subcommand.
Constructors
OptionSubcommandGroup | |
Fields
| |
OptionSubcommandOrGroupSubcommand OptionSubcommand |
Instances
data OptionSubcommand Source #
Data for a single subcommand.
Constructors
OptionSubcommand | |
Fields
|
Instances
data OptionValue Source #
Data for a single value.
Constructors
OptionValueString | |
Fields
| |
OptionValueInteger | |
Fields
| |
OptionValueBoolean | |
Fields
| |
OptionValueUser | |
Fields
| |
OptionValueChannel | |
Fields
| |
OptionValueRole | |
Fields
| |
OptionValueMentionable | |
Fields
| |
OptionValueNumber | |
Fields
|
Instances
Eq OptionValue Source # | |
Defined in Discord.Internal.Types.ApplicationCommands | |
Read OptionValue Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods readsPrec :: Int -> ReadS OptionValue # readList :: ReadS [OptionValue] # readPrec :: ReadPrec OptionValue # readListPrec :: ReadPrec [OptionValue] # | |
Show OptionValue Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods showsPrec :: Int -> OptionValue -> ShowS # show :: OptionValue -> String # showList :: [OptionValue] -> ShowS # | |
ToJSON OptionValue Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods toJSON :: OptionValue -> Value # toEncoding :: OptionValue -> Encoding # toJSONList :: [OptionValue] -> Value # toEncodingList :: [OptionValue] -> Encoding # | |
FromJSON OptionValue Source # | |
Defined in Discord.Internal.Types.ApplicationCommands |
createChatInput :: Text -> Text -> Maybe CreateApplicationCommand Source #
Create the basics for a chat input (slash command). Use record overwriting to enter the other values. The name needs to be all lower case letters, and between 1 and 32 characters. The description has to be non-empty and less than or equal to 100 characters.
createUser :: Text -> Maybe CreateApplicationCommand Source #
Create the basics for a user command. Use record overwriting to enter the other values. The name needs to be between 1 and 32 characters.
createMessage :: Text -> Maybe CreateApplicationCommand Source #
Create the basics for a message command. Use record overwriting to enter the other values. The name needs to be between 1 and 32 characters.
data CreateApplicationCommand Source #
Data type to be used when creating application commands. The specification is below.
If a command of the same type and and name is sent to the server, it will overwrite any command that already exists in the same scope (guild vs global).
The description has to be empty for non-slash command application
commands, as do the options. The options need to be Nothing
for non-slash
commands, too. If one of the options is a subcommand or subcommand group,
the base command will no longer be usable.
A subcommand group can have subcommands within it. This is the maximum amount of command nesting permitted.
Constructors
CreateApplicationCommandChatInput | |
Fields
| |
CreateApplicationCommandUser | |
Fields
| |
CreateApplicationCommandMessage | |
Fields
|
Instances
Eq CreateApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods (==) :: CreateApplicationCommand -> CreateApplicationCommand -> Bool # (/=) :: CreateApplicationCommand -> CreateApplicationCommand -> Bool # | |
Read CreateApplicationCommand Source # | |
Show CreateApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods showsPrec :: Int -> CreateApplicationCommand -> ShowS # show :: CreateApplicationCommand -> String # showList :: [CreateApplicationCommand] -> ShowS # | |
ToJSON CreateApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods toJSON :: CreateApplicationCommand -> Value # toEncoding :: CreateApplicationCommand -> Encoding # toJSONList :: [CreateApplicationCommand] -> Value # |
data EditApplicationCommand Source #
Data type to be used when editing application commands. The specification
is below. See CreateApplicationCommand
for an explanation for the
parameters.
Constructors
EditApplicationCommandChatInput | |
Fields | |
EditApplicationCommandUser | |
EditApplicationCommandMessage | |
Instances
ToJSON EditApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods toJSON :: EditApplicationCommand -> Value # toEncoding :: EditApplicationCommand -> Encoding # toJSONList :: [EditApplicationCommand] -> Value # |
Constructors
Choice | |
Fields
|
Instances
Functor Choice Source # | |
Eq a => Eq (Choice a) Source # | |
Ord a => Ord (Choice a) Source # | |
Defined in Discord.Internal.Types.ApplicationCommands | |
Read a => Read (Choice a) Source # | |
Show a => Show (Choice a) Source # | |
ToJSON a => ToJSON (Choice a) Source # | |
Defined in Discord.Internal.Types.ApplicationCommands | |
FromJSON a => FromJSON (Choice a) Source # | |
data ApplicationCommandChannelType Source #
The different channel types.
https://discord.com/developers/docs/resources/channel#channel-object-channel-types
Constructors
ApplicationCommandChannelTypeGuildText | A text channel in a server. |
ApplicationCommandChannelTypeDM | A direct message between users. |
ApplicationCommandChannelTypeGuildVoice | A voice channel in a server. |
ApplicationCommandChannelTypeGroupDM | A direct message between multiple users. |
ApplicationCommandChannelTypeGuildCategory | An organizational category that contains up to 50 channels. |
ApplicationCommandChannelTypeGuildNews | A channel that users can follow and crosspost into their own server. |
ApplicationCommandChannelTypeGuildStore | A channel in which game developers can sell their game on discord. |
ApplicationCommandChannelTypeGuildNewsThread | A temporary sub-channel within a guild_news channel. |
ApplicationCommandChannelTypeGuildPublicThread | A temporary sub-channel within a guild_text channel. |
ApplicationCommandChannelTypeGuildPrivateThread | A temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission |
ApplicationCommandChannelTypeGuildStageVoice | A voice channel for hosting events with an audience. |
Instances
data GuildApplicationCommandPermissions Source #
Constructors
GuildApplicationCommandPermissions | |
Fields
|
Instances
data ApplicationCommandPermissions Source #
Application command permissions allow you to enable or disable commands for specific users or roles within a guild.
Constructors
ApplicationCommandPermissions | |
Fields
|
Instances
type Number = Scientific Source #