Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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.
ApplicationCommandUser | |
| |
ApplicationCommandMessage | |
| |
ApplicationCommandChatInput | |
|
Instances
FromJSON ApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands | |
Read ApplicationCommand Source # | |
Show ApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands showsPrec :: Int -> ApplicationCommand -> ShowS # show :: ApplicationCommand -> String # showList :: [ApplicationCommand] -> ShowS # | |
Eq ApplicationCommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands (==) :: ApplicationCommand -> ApplicationCommand -> Bool # (/=) :: ApplicationCommand -> ApplicationCommand -> Bool # |
Either subcommands and groups, or values.
data OptionSubcommandOrGroup Source #
Either a subcommand group or a subcommand.
OptionSubcommandGroup | |
| |
OptionSubcommandOrGroupSubcommand OptionSubcommand |
Instances
data OptionSubcommand Source #
Data for a single subcommand.
OptionSubcommand | |
|
Instances
FromJSON OptionSubcommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands parseJSON :: Value -> Parser OptionSubcommand # parseJSONList :: Value -> Parser [OptionSubcommand] # | |
ToJSON OptionSubcommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands toJSON :: OptionSubcommand -> Value # toEncoding :: OptionSubcommand -> Encoding # toJSONList :: [OptionSubcommand] -> Value # toEncodingList :: [OptionSubcommand] -> Encoding # omitField :: OptionSubcommand -> Bool # | |
Read OptionSubcommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands | |
Show OptionSubcommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands showsPrec :: Int -> OptionSubcommand -> ShowS # show :: OptionSubcommand -> String # showList :: [OptionSubcommand] -> ShowS # | |
Eq OptionSubcommand Source # | |
Defined in Discord.Internal.Types.ApplicationCommands (==) :: OptionSubcommand -> OptionSubcommand -> Bool # (/=) :: OptionSubcommand -> OptionSubcommand -> Bool # |
data OptionValue Source #
Data for a single value.
OptionValueString | |
| |
OptionValueInteger | |
| |
OptionValueBoolean | |
| |
OptionValueUser | |
| |
OptionValueChannel | |
| |
OptionValueRole | |
| |
OptionValueMentionable | |
| |
OptionValueNumber | |
|
Instances
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.
CreateApplicationCommandChatInput | |
| |
CreateApplicationCommandUser | |
| |
CreateApplicationCommandMessage | |
|
Instances
data EditApplicationCommand Source #
Data type to be used when editing application commands. The specification
is below. See CreateApplicationCommand
for an explanation for the
parameters.
Instances
Choice | |
|
Instances
Functor Choice Source # | |
FromJSON a => FromJSON (AutocompleteOrChoice a) Source # | |
Defined in Discord.Internal.Types.ApplicationCommands 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
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 #
GuildApplicationCommandPermissions | |
|
Instances
data ApplicationCommandPermissions Source #
Application command permissions allow you to enable or disable commands for specific users or roles within a guild.
ApplicationCommandPermissions | |
|
Instances
type Number = Scientific Source #
A discord locale. See https://discord.com/developers/docs/reference#locales for available locales