Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Discord.Internal.Types.ApplicationCommands
Synopsis
- data ApplicationCommand
- = ApplicationCommandUser {
- applicationCommandId :: ApplicationCommandId
- applicationCommandApplicationId :: ApplicationId
- applicationCommandGuildId :: Maybe GuildId
- applicationCommandName :: Text
- applicationCommandLocalizedName :: Maybe LocalizedText
- applicationCommandDefaultMemberPermissions :: Maybe Text
- applicationCommandDMPermission :: Maybe Bool
- applicationCommandVersion :: Snowflake
- | ApplicationCommandMessage {
- applicationCommandId :: ApplicationCommandId
- applicationCommandApplicationId :: ApplicationId
- applicationCommandGuildId :: Maybe GuildId
- applicationCommandName :: Text
- applicationCommandLocalizedName :: Maybe LocalizedText
- applicationCommandDefaultMemberPermissions :: Maybe Text
- applicationCommandDMPermission :: Maybe Bool
- applicationCommandVersion :: Snowflake
- | ApplicationCommandChatInput {
- applicationCommandId :: ApplicationCommandId
- applicationCommandApplicationId :: ApplicationId
- applicationCommandGuildId :: Maybe GuildId
- applicationCommandName :: Text
- applicationCommandLocalizedName :: Maybe LocalizedText
- applicationCommandDescription :: Text
- applicationCommandLocalizedDescription :: Maybe LocalizedText
- applicationCommandOptions :: Maybe Options
- applicationCommandDefaultMemberPermissions :: Maybe Text
- applicationCommandDMPermission :: Maybe Bool
- applicationCommandVersion :: Snowflake
- = ApplicationCommandUser {
- data Options
- data OptionSubcommandOrGroup
- data OptionSubcommand = OptionSubcommand {}
- data OptionValue
- = OptionValueString {
- optionValueName :: Text
- optionValueLocalizedName :: Maybe LocalizedText
- optionValueDescription :: Text
- optionValueLocalizedDescription :: Maybe LocalizedText
- optionValueRequired :: Bool
- optionValueStringChoices :: AutocompleteOrChoice Text
- optionValueStringMinLen :: Maybe Integer
- optionValueStringMaxLen :: Maybe Integer
- | OptionValueInteger {
- optionValueName :: Text
- optionValueLocalizedName :: Maybe LocalizedText
- optionValueDescription :: Text
- optionValueLocalizedDescription :: Maybe LocalizedText
- optionValueRequired :: Bool
- optionValueIntegerChoices :: AutocompleteOrChoice Integer
- optionValueIntegerMinVal :: Maybe Integer
- optionValueIntegerMaxVal :: Maybe Integer
- | OptionValueBoolean { }
- | OptionValueUser { }
- | OptionValueChannel { }
- | OptionValueRole { }
- | OptionValueMentionable { }
- | OptionValueNumber {
- optionValueName :: Text
- optionValueLocalizedName :: Maybe LocalizedText
- optionValueDescription :: Text
- optionValueLocalizedDescription :: Maybe LocalizedText
- 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 {}
- data ChannelTypeOption
- = ChannelTypeOptionGuildText
- | ChannelTypeOptionDM
- | ChannelTypeOptionGuildVoice
- | ChannelTypeOptionGroupDM
- | ChannelTypeOptionGuildCategory
- | ChannelTypeOptionGuildNews
- | ChannelTypeOptionGuildStore
- | ChannelTypeOptionGuildNewsThread
- | ChannelTypeOptionGuildPublicThread
- | ChannelTypeOptionGuildPrivateThread
- | ChannelTypeOptionGuildStageVoice
- data GuildApplicationCommandPermissions = GuildApplicationCommandPermissions {}
- data ApplicationCommandPermissions = ApplicationCommandPermissions {}
- type Number = Scientific
- type AutocompleteOrChoice a = Either Bool [Choice a]
- type LocalizedText = Map Locale Text
- type Locale = Text
Documentation
data ApplicationCommand Source #
The structure for an application command.
Constructors
ApplicationCommandUser | |
Fields
| |
ApplicationCommandMessage | |
Fields
| |
ApplicationCommandChatInput | |
Fields
|
Instances
FromJSON ApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods parseJSON :: Value -> Parser ApplicationCommand # parseJSONList :: Value -> Parser [ApplicationCommand] # | |
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 # | |
Eq ApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods (==) :: ApplicationCommand -> ApplicationCommand -> Bool # (/=) :: ApplicationCommand -> ApplicationCommand -> Bool # |
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
FromJSON OptionValue Source # | |
Defined in Discord.Internal.Types.ApplicationCommands | |
ToJSON OptionValue Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods toJSON :: OptionValue -> Value # toEncoding :: OptionValue -> Encoding # toJSONList :: [OptionValue] -> Value # toEncodingList :: [OptionValue] -> Encoding # omitField :: OptionValue -> Bool # | |
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 # | |
Eq 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
ToJSON CreateApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods toJSON :: CreateApplicationCommand -> Value # toEncoding :: CreateApplicationCommand -> Encoding # toJSONList :: [CreateApplicationCommand] -> Value # | |
Read CreateApplicationCommand Source # | |
Show CreateApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods showsPrec :: Int -> CreateApplicationCommand -> ShowS # show :: CreateApplicationCommand -> String # showList :: [CreateApplicationCommand] -> ShowS # | |
Eq CreateApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods (==) :: CreateApplicationCommand -> CreateApplicationCommand -> Bool # (/=) :: CreateApplicationCommand -> CreateApplicationCommand -> Bool # |
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 | |
EditApplicationCommandUser | |
Fields | |
EditApplicationCommandMessage | |
Fields |
Instances
ToJSON EditApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods toJSON :: EditApplicationCommand -> Value # toEncoding :: EditApplicationCommand -> Encoding # toJSONList :: [EditApplicationCommand] -> Value # toEncodingList :: [EditApplicationCommand] -> Encoding # omitField :: EditApplicationCommand -> Bool # |
Constructors
Choice | |
Fields
|
Instances
Functor Choice Source # | |
FromJSON a => FromJSON (AutocompleteOrChoice a) Source # | |
Defined in Discord.Internal.Types.ApplicationCommands Methods parseJSON :: Value -> Parser (AutocompleteOrChoice a) # parseJSONList :: Value -> Parser [AutocompleteOrChoice a] # omittedField :: Maybe (AutocompleteOrChoice a) # | |
FromJSON a => FromJSON (Choice a) Source # | |
Defined in Discord.Internal.Types.ApplicationCommands | |
ToJSON a => ToJSON (Choice a) Source # | |
Read a => Read (Choice a) Source # | |
Show a => Show (Choice a) Source # | |
Eq a => Eq (Choice a) Source # | |
Ord a => Ord (Choice a) Source # | |
Defined in Discord.Internal.Types.ApplicationCommands |
data ChannelTypeOption Source #
The different channel types. Used for application commands and components.
https://discord.com/developers/docs/resources/channel#channel-object-channel-types
Constructors
ChannelTypeOptionGuildText | A text channel in a server. |
ChannelTypeOptionDM | A direct message between users. |
ChannelTypeOptionGuildVoice | A voice channel in a server. |
ChannelTypeOptionGroupDM | A direct message between multiple users. |
ChannelTypeOptionGuildCategory | An organizational category that contains up to 50 channels. |
ChannelTypeOptionGuildNews | A channel that users can follow and crosspost into their own server. |
ChannelTypeOptionGuildStore | A channel in which game developers can sell their game on discord. |
ChannelTypeOptionGuildNewsThread | A temporary sub-channel within a guild_news channel. |
ChannelTypeOptionGuildPublicThread | A temporary sub-channel within a guild_text channel. |
ChannelTypeOptionGuildPrivateThread | A temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission |
ChannelTypeOptionGuildStageVoice | 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 #
A discord locale. See https://discord.com/developers/docs/reference#locales for available locales