discord-haskell 1.12.5 → 1.13.0
raw patch · 15 files changed
+523/−438 lines, 15 filesdep −unordered-containersPVP ok
version bump matches the API change (PVP)
Dependencies removed: unordered-containers
API changes (from Hackage documentation)
- Discord.Internal.Types.ApplicationCommands: ApplicationCommandOptionSubcommand :: Text -> Text -> [ApplicationCommandOptionValue] -> ApplicationCommandOptionSubcommand
- Discord.Internal.Types.ApplicationCommands: ApplicationCommandOptionSubcommandGroup :: Text -> Text -> [ApplicationCommandOptionSubcommand] -> ApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.ApplicationCommands: ApplicationCommandOptionSubcommandOrGroupSubcommand :: ApplicationCommandOptionSubcommand -> ApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.ApplicationCommands: ApplicationCommandOptionValueBoolean :: Text -> Text -> Bool -> ApplicationCommandOptionValue
- Discord.Internal.Types.ApplicationCommands: ApplicationCommandOptionValueChannel :: Text -> Text -> Bool -> Maybe [ApplicationCommandChannelType] -> ApplicationCommandOptionValue
- Discord.Internal.Types.ApplicationCommands: ApplicationCommandOptionValueInteger :: Text -> Text -> Bool -> AutocompleteOrChoice Integer -> Maybe Integer -> Maybe Integer -> ApplicationCommandOptionValue
- Discord.Internal.Types.ApplicationCommands: ApplicationCommandOptionValueMentionable :: Text -> Text -> Bool -> ApplicationCommandOptionValue
- Discord.Internal.Types.ApplicationCommands: ApplicationCommandOptionValueNumber :: Text -> Text -> Bool -> AutocompleteOrChoice Scientific -> Maybe Scientific -> Maybe Scientific -> ApplicationCommandOptionValue
- Discord.Internal.Types.ApplicationCommands: ApplicationCommandOptionValueRole :: Text -> Text -> Bool -> ApplicationCommandOptionValue
- Discord.Internal.Types.ApplicationCommands: ApplicationCommandOptionValueString :: Text -> Text -> Bool -> AutocompleteOrChoice Text -> ApplicationCommandOptionValue
- Discord.Internal.Types.ApplicationCommands: ApplicationCommandOptionValueUser :: Text -> Text -> Bool -> ApplicationCommandOptionValue
- Discord.Internal.Types.ApplicationCommands: ApplicationCommandOptionsSubcommands :: [ApplicationCommandOptionSubcommandOrGroup] -> ApplicationCommandOptions
- Discord.Internal.Types.ApplicationCommands: ApplicationCommandOptionsValues :: [ApplicationCommandOptionValue] -> ApplicationCommandOptions
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionSubcommandDescription] :: ApplicationCommandOptionSubcommand -> Text
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionSubcommandGroupDescription] :: ApplicationCommandOptionSubcommandOrGroup -> Text
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionSubcommandGroupName] :: ApplicationCommandOptionSubcommandOrGroup -> Text
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionSubcommandGroupOptions] :: ApplicationCommandOptionSubcommandOrGroup -> [ApplicationCommandOptionSubcommand]
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionSubcommandName] :: ApplicationCommandOptionSubcommand -> Text
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionSubcommandOptions] :: ApplicationCommandOptionSubcommand -> [ApplicationCommandOptionValue]
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionValueChannelTypes] :: ApplicationCommandOptionValue -> Maybe [ApplicationCommandChannelType]
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionValueDescription] :: ApplicationCommandOptionValue -> Text
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionValueIntegerChoices] :: ApplicationCommandOptionValue -> AutocompleteOrChoice Integer
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionValueIntegerMaxVal] :: ApplicationCommandOptionValue -> Maybe Integer
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionValueIntegerMinVal] :: ApplicationCommandOptionValue -> Maybe Integer
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionValueName] :: ApplicationCommandOptionValue -> Text
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionValueNumberChoices] :: ApplicationCommandOptionValue -> AutocompleteOrChoice Scientific
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionValueNumberMaxVal] :: ApplicationCommandOptionValue -> Maybe Scientific
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionValueNumberMinVal] :: ApplicationCommandOptionValue -> Maybe Scientific
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionValueRequired] :: ApplicationCommandOptionValue -> Bool
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptionValueStringChoices] :: ApplicationCommandOptionValue -> AutocompleteOrChoice Text
- Discord.Internal.Types.ApplicationCommands: [createApplicationCommandDefaultPermission] :: CreateApplicationCommand -> Bool
- Discord.Internal.Types.ApplicationCommands: [createApplicationCommandDescription] :: CreateApplicationCommand -> Text
- Discord.Internal.Types.ApplicationCommands: [createApplicationCommandName] :: CreateApplicationCommand -> Text
- Discord.Internal.Types.ApplicationCommands: [createApplicationCommandOptions] :: CreateApplicationCommand -> Maybe ApplicationCommandOptions
- Discord.Internal.Types.ApplicationCommands: [editApplicationCommandDefaultPermission] :: EditApplicationCommand -> Maybe Bool
- Discord.Internal.Types.ApplicationCommands: [editApplicationCommandDescription] :: EditApplicationCommand -> Maybe Text
- Discord.Internal.Types.ApplicationCommands: [editApplicationCommandName] :: EditApplicationCommand -> Maybe Text
- Discord.Internal.Types.ApplicationCommands: [editApplicationCommandOptions] :: EditApplicationCommand -> Maybe ApplicationCommandOptions
- Discord.Internal.Types.ApplicationCommands: createApplicationCommandChatInput :: Text -> Text -> Maybe CreateApplicationCommand
- Discord.Internal.Types.ApplicationCommands: createApplicationCommandMessage :: Text -> Maybe CreateApplicationCommand
- Discord.Internal.Types.ApplicationCommands: createApplicationCommandUser :: Text -> Maybe CreateApplicationCommand
- Discord.Internal.Types.ApplicationCommands: data ApplicationCommandOptionSubcommand
- Discord.Internal.Types.ApplicationCommands: data ApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.ApplicationCommands: data ApplicationCommandOptionValue
- Discord.Internal.Types.ApplicationCommands: data ApplicationCommandOptions
- Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptionSubcommand
- Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptionValue
- Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptions
- Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptionSubcommand
- Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptionValue
- Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptions
- Discord.Internal.Types.ApplicationCommands: instance GHC.Classes.Eq Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptionSubcommand
- Discord.Internal.Types.ApplicationCommands: instance GHC.Classes.Eq Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.ApplicationCommands: instance GHC.Classes.Eq Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptionValue
- Discord.Internal.Types.ApplicationCommands: instance GHC.Classes.Eq Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptions
- Discord.Internal.Types.ApplicationCommands: instance GHC.Read.Read Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptionSubcommand
- Discord.Internal.Types.ApplicationCommands: instance GHC.Read.Read Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.ApplicationCommands: instance GHC.Read.Read Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptionValue
- Discord.Internal.Types.ApplicationCommands: instance GHC.Read.Read Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptions
- Discord.Internal.Types.ApplicationCommands: instance GHC.Show.Show Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptionSubcommand
- Discord.Internal.Types.ApplicationCommands: instance GHC.Show.Show Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.ApplicationCommands: instance GHC.Show.Show Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptionValue
- Discord.Internal.Types.ApplicationCommands: instance GHC.Show.Show Discord.Internal.Types.ApplicationCommands.ApplicationCommandOptions
- Discord.Internal.Types.Components: ComponentActionRowButton :: [ComponentButton] -> ComponentActionRow
- Discord.Internal.Types.Components: ComponentActionRowSelectMenu :: ComponentSelectMenu -> ComponentActionRow
- Discord.Internal.Types.Components: ComponentButton :: Text -> Bool -> ButtonStyle -> Maybe Text -> Maybe Emoji -> ComponentButton
- Discord.Internal.Types.Components: ComponentButtonUrl :: Text -> Bool -> Maybe Text -> Maybe Emoji -> ComponentButton
- Discord.Internal.Types.Components: ComponentSelectMenu :: Text -> Bool -> [SelectOption] -> Maybe Text -> Maybe Integer -> Maybe Integer -> ComponentSelectMenu
- Discord.Internal.Types.Components: ComponentTextInput :: Text -> Bool -> Text -> Maybe Integer -> Maybe Integer -> Bool -> Text -> Text -> ComponentTextInput
- Discord.Internal.Types.Components: [componentButtonCustomId] :: ComponentButton -> Text
- Discord.Internal.Types.Components: [componentButtonDisabled] :: ComponentButton -> Bool
- Discord.Internal.Types.Components: [componentButtonEmoji] :: ComponentButton -> Maybe Emoji
- Discord.Internal.Types.Components: [componentButtonLabel] :: ComponentButton -> Maybe Text
- Discord.Internal.Types.Components: [componentButtonStyle] :: ComponentButton -> ButtonStyle
- Discord.Internal.Types.Components: [componentButtonUrl] :: ComponentButton -> Text
- Discord.Internal.Types.Components: [componentSelectMenuCustomId] :: ComponentSelectMenu -> Text
- Discord.Internal.Types.Components: [componentSelectMenuDisabled] :: ComponentSelectMenu -> Bool
- Discord.Internal.Types.Components: [componentSelectMenuMaxValues] :: ComponentSelectMenu -> Maybe Integer
- Discord.Internal.Types.Components: [componentSelectMenuMinValues] :: ComponentSelectMenu -> Maybe Integer
- Discord.Internal.Types.Components: [componentSelectMenuOptions] :: ComponentSelectMenu -> [SelectOption]
- Discord.Internal.Types.Components: [componentSelectMenuPlaceholder] :: ComponentSelectMenu -> Maybe Text
- Discord.Internal.Types.Components: [componentTextInputCustomId] :: ComponentTextInput -> Text
- Discord.Internal.Types.Components: [componentTextInputIsParagraph] :: ComponentTextInput -> Bool
- Discord.Internal.Types.Components: [componentTextInputLabel] :: ComponentTextInput -> Text
- Discord.Internal.Types.Components: [componentTextInputMaxLength] :: ComponentTextInput -> Maybe Integer
- Discord.Internal.Types.Components: [componentTextInputMinLength] :: ComponentTextInput -> Maybe Integer
- Discord.Internal.Types.Components: [componentTextInputPlaceholder] :: ComponentTextInput -> Text
- Discord.Internal.Types.Components: [componentTextInputRequired] :: ComponentTextInput -> Bool
- Discord.Internal.Types.Components: [componentTextInputValue] :: ComponentTextInput -> Text
- Discord.Internal.Types.Components: data ComponentActionRow
- Discord.Internal.Types.Components: data ComponentButton
- Discord.Internal.Types.Components: data ComponentSelectMenu
- Discord.Internal.Types.Components: data ComponentTextInput
- Discord.Internal.Types.Components: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Components.ComponentActionRow
- Discord.Internal.Types.Components: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Components.ComponentButton
- Discord.Internal.Types.Components: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Components.ComponentSelectMenu
- Discord.Internal.Types.Components: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Components.ComponentTextInput
- Discord.Internal.Types.Components: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.Components.ComponentActionRow
- Discord.Internal.Types.Components: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.Components.ComponentButton
- Discord.Internal.Types.Components: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.Components.ComponentSelectMenu
- Discord.Internal.Types.Components: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.Components.ComponentTextInput
- Discord.Internal.Types.Components: instance GHC.Classes.Eq Discord.Internal.Types.Components.ComponentActionRow
- Discord.Internal.Types.Components: instance GHC.Classes.Eq Discord.Internal.Types.Components.ComponentButton
- Discord.Internal.Types.Components: instance GHC.Classes.Eq Discord.Internal.Types.Components.ComponentSelectMenu
- Discord.Internal.Types.Components: instance GHC.Classes.Eq Discord.Internal.Types.Components.ComponentTextInput
- Discord.Internal.Types.Components: instance GHC.Classes.Ord Discord.Internal.Types.Components.ComponentActionRow
- Discord.Internal.Types.Components: instance GHC.Classes.Ord Discord.Internal.Types.Components.ComponentButton
- Discord.Internal.Types.Components: instance GHC.Classes.Ord Discord.Internal.Types.Components.ComponentSelectMenu
- Discord.Internal.Types.Components: instance GHC.Classes.Ord Discord.Internal.Types.Components.ComponentTextInput
- Discord.Internal.Types.Components: instance GHC.Read.Read Discord.Internal.Types.Components.ComponentActionRow
- Discord.Internal.Types.Components: instance GHC.Read.Read Discord.Internal.Types.Components.ComponentButton
- Discord.Internal.Types.Components: instance GHC.Read.Read Discord.Internal.Types.Components.ComponentSelectMenu
- Discord.Internal.Types.Components: instance GHC.Read.Read Discord.Internal.Types.Components.ComponentTextInput
- Discord.Internal.Types.Components: instance GHC.Show.Show Discord.Internal.Types.Components.ComponentActionRow
- Discord.Internal.Types.Components: instance GHC.Show.Show Discord.Internal.Types.Components.ComponentButton
- Discord.Internal.Types.Components: instance GHC.Show.Show Discord.Internal.Types.Components.ComponentSelectMenu
- Discord.Internal.Types.Components: instance GHC.Show.Show Discord.Internal.Types.Components.ComponentTextInput
- Discord.Internal.Types.Components: mkComponentTextInput :: Text -> Text -> ComponentTextInput
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandChatInput :: ApplicationCommandId -> Text -> Maybe ResolvedData -> Maybe InteractionDataApplicationCommandOptions -> InteractionDataApplicationCommand
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandMessage :: ApplicationCommandId -> Text -> Maybe ResolvedData -> MessageId -> InteractionDataApplicationCommand
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandOptionSubcommand :: Text -> [InteractionDataApplicationCommandOptionValue] -> Bool -> InteractionDataApplicationCommandOptionSubcommand
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandOptionSubcommandGroup :: Text -> [InteractionDataApplicationCommandOptionSubcommand] -> Bool -> InteractionDataApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandOptionSubcommandOrGroupSubcommand :: InteractionDataApplicationCommandOptionSubcommand -> InteractionDataApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandOptionValueBoolean :: Text -> Bool -> InteractionDataApplicationCommandOptionValue
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandOptionValueChannel :: Text -> ChannelId -> InteractionDataApplicationCommandOptionValue
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandOptionValueInteger :: Text -> Either Text Integer -> InteractionDataApplicationCommandOptionValue
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandOptionValueMentionable :: Text -> Snowflake -> InteractionDataApplicationCommandOptionValue
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandOptionValueNumber :: Text -> Either Text Scientific -> InteractionDataApplicationCommandOptionValue
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandOptionValueRole :: Text -> RoleId -> InteractionDataApplicationCommandOptionValue
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandOptionValueString :: Text -> Either Text Text -> InteractionDataApplicationCommandOptionValue
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandOptionValueUser :: Text -> UserId -> InteractionDataApplicationCommandOptionValue
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandOptionsSubcommands :: [InteractionDataApplicationCommandOptionSubcommandOrGroup] -> InteractionDataApplicationCommandOptions
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandOptionsValues :: [InteractionDataApplicationCommandOptionValue] -> InteractionDataApplicationCommandOptions
- Discord.Internal.Types.Interactions: InteractionDataApplicationCommandUser :: ApplicationCommandId -> Text -> Maybe ResolvedData -> UserId -> InteractionDataApplicationCommand
- Discord.Internal.Types.Interactions: InteractionDataComponentButton :: Text -> InteractionDataComponent
- Discord.Internal.Types.Interactions: InteractionDataComponentSelectMenu :: Text -> [Text] -> InteractionDataComponent
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandId] :: InteractionDataApplicationCommand -> ApplicationCommandId
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandName] :: InteractionDataApplicationCommand -> Text
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptionSubcommandFocused] :: InteractionDataApplicationCommandOptionSubcommand -> Bool
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptionSubcommandGroupFocused] :: InteractionDataApplicationCommandOptionSubcommandOrGroup -> Bool
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptionSubcommandGroupName] :: InteractionDataApplicationCommandOptionSubcommandOrGroup -> Text
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptionSubcommandGroupOptions] :: InteractionDataApplicationCommandOptionSubcommandOrGroup -> [InteractionDataApplicationCommandOptionSubcommand]
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptionSubcommandName] :: InteractionDataApplicationCommandOptionSubcommand -> Text
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptionSubcommandOptions] :: InteractionDataApplicationCommandOptionSubcommand -> [InteractionDataApplicationCommandOptionValue]
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptionValueBooleanValue] :: InteractionDataApplicationCommandOptionValue -> Bool
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptionValueChannelValue] :: InteractionDataApplicationCommandOptionValue -> ChannelId
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptionValueIntegerValue] :: InteractionDataApplicationCommandOptionValue -> Either Text Integer
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptionValueMentionableValue] :: InteractionDataApplicationCommandOptionValue -> Snowflake
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptionValueName] :: InteractionDataApplicationCommandOptionValue -> Text
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptionValueNumberValue] :: InteractionDataApplicationCommandOptionValue -> Either Text Scientific
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptionValueRoleValue] :: InteractionDataApplicationCommandOptionValue -> RoleId
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptionValueStringValue] :: InteractionDataApplicationCommandOptionValue -> Either Text Text
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptionValueUserValue] :: InteractionDataApplicationCommandOptionValue -> UserId
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandOptions] :: InteractionDataApplicationCommand -> Maybe InteractionDataApplicationCommandOptions
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandResolvedData] :: InteractionDataApplicationCommand -> Maybe ResolvedData
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommandTargetId] :: InteractionDataApplicationCommand -> MessageId
- Discord.Internal.Types.Interactions: [interactionDataApplicationCommand] :: Interaction -> InteractionDataApplicationCommand
- Discord.Internal.Types.Interactions: [interactionDataComponentCustomId] :: InteractionDataComponent -> Text
- Discord.Internal.Types.Interactions: [interactionDataComponentValues] :: InteractionDataComponent -> [Text]
- Discord.Internal.Types.Interactions: [interactionDataComponent] :: Interaction -> InteractionDataComponent
- Discord.Internal.Types.Interactions: [interactionDataModal] :: Interaction -> InteractionDataModal
- Discord.Internal.Types.Interactions: data InteractionDataApplicationCommand
- Discord.Internal.Types.Interactions: data InteractionDataApplicationCommandOptionSubcommand
- Discord.Internal.Types.Interactions: data InteractionDataApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.Interactions: data InteractionDataApplicationCommandOptionValue
- Discord.Internal.Types.Interactions: data InteractionDataApplicationCommandOptions
- Discord.Internal.Types.Interactions: data InteractionDataComponent
- Discord.Internal.Types.Interactions: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Interactions.InteractionDataApplicationCommand
- Discord.Internal.Types.Interactions: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptionSubcommand
- Discord.Internal.Types.Interactions: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.Interactions: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptionValue
- Discord.Internal.Types.Interactions: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptions
- Discord.Internal.Types.Interactions: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Interactions.InteractionDataComponent
- Discord.Internal.Types.Interactions: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Interactions.InteractionDataModal
- Discord.Internal.Types.Interactions: instance GHC.Classes.Eq Discord.Internal.Types.Interactions.InteractionDataApplicationCommand
- Discord.Internal.Types.Interactions: instance GHC.Classes.Eq Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptionSubcommand
- Discord.Internal.Types.Interactions: instance GHC.Classes.Eq Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.Interactions: instance GHC.Classes.Eq Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptionValue
- Discord.Internal.Types.Interactions: instance GHC.Classes.Eq Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptions
- Discord.Internal.Types.Interactions: instance GHC.Classes.Eq Discord.Internal.Types.Interactions.InteractionDataComponent
- Discord.Internal.Types.Interactions: instance GHC.Classes.Eq Discord.Internal.Types.Interactions.InteractionDataModal
- Discord.Internal.Types.Interactions: instance GHC.Classes.Ord Discord.Internal.Types.Interactions.InteractionDataApplicationCommand
- Discord.Internal.Types.Interactions: instance GHC.Classes.Ord Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptionSubcommand
- Discord.Internal.Types.Interactions: instance GHC.Classes.Ord Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.Interactions: instance GHC.Classes.Ord Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptionValue
- Discord.Internal.Types.Interactions: instance GHC.Classes.Ord Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptions
- Discord.Internal.Types.Interactions: instance GHC.Classes.Ord Discord.Internal.Types.Interactions.InteractionDataComponent
- Discord.Internal.Types.Interactions: instance GHC.Classes.Ord Discord.Internal.Types.Interactions.InteractionDataModal
- Discord.Internal.Types.Interactions: instance GHC.Read.Read Discord.Internal.Types.Interactions.InteractionDataApplicationCommand
- Discord.Internal.Types.Interactions: instance GHC.Read.Read Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptionSubcommand
- Discord.Internal.Types.Interactions: instance GHC.Read.Read Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.Interactions: instance GHC.Read.Read Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptionValue
- Discord.Internal.Types.Interactions: instance GHC.Read.Read Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptions
- Discord.Internal.Types.Interactions: instance GHC.Read.Read Discord.Internal.Types.Interactions.InteractionDataComponent
- Discord.Internal.Types.Interactions: instance GHC.Read.Read Discord.Internal.Types.Interactions.InteractionDataModal
- Discord.Internal.Types.Interactions: instance GHC.Show.Show Discord.Internal.Types.Interactions.InteractionDataApplicationCommand
- Discord.Internal.Types.Interactions: instance GHC.Show.Show Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptionSubcommand
- Discord.Internal.Types.Interactions: instance GHC.Show.Show Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptionSubcommandOrGroup
- Discord.Internal.Types.Interactions: instance GHC.Show.Show Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptionValue
- Discord.Internal.Types.Interactions: instance GHC.Show.Show Discord.Internal.Types.Interactions.InteractionDataApplicationCommandOptions
- Discord.Internal.Types.Interactions: instance GHC.Show.Show Discord.Internal.Types.Interactions.InteractionDataComponent
- Discord.Internal.Types.Interactions: instance GHC.Show.Show Discord.Internal.Types.Interactions.InteractionDataModal
- Discord.Internal.Types.Interactions: type InteractionToken = Text
- Discord.Internal.Types.Prelude: type InteractionToken = Text
- Discord.Types: ComponentActionRowButton :: [ComponentButton] -> ComponentActionRow
- Discord.Types: ComponentActionRowSelectMenu :: ComponentSelectMenu -> ComponentActionRow
- Discord.Types: ComponentButton :: Text -> Bool -> ButtonStyle -> Maybe Text -> Maybe Emoji -> ComponentButton
- Discord.Types: ComponentButtonUrl :: Text -> Bool -> Maybe Text -> Maybe Emoji -> ComponentButton
- Discord.Types: ComponentSelectMenu :: Text -> Bool -> [SelectOption] -> Maybe Text -> Maybe Integer -> Maybe Integer -> ComponentSelectMenu
- Discord.Types: ComponentTextInput :: Text -> Bool -> Text -> Maybe Integer -> Maybe Integer -> Bool -> Text -> Text -> ComponentTextInput
- Discord.Types: [componentButtonCustomId] :: ComponentButton -> Text
- Discord.Types: [componentButtonDisabled] :: ComponentButton -> Bool
- Discord.Types: [componentButtonEmoji] :: ComponentButton -> Maybe Emoji
- Discord.Types: [componentButtonLabel] :: ComponentButton -> Maybe Text
- Discord.Types: [componentButtonStyle] :: ComponentButton -> ButtonStyle
- Discord.Types: [componentButtonUrl] :: ComponentButton -> Text
- Discord.Types: [componentSelectMenuCustomId] :: ComponentSelectMenu -> Text
- Discord.Types: [componentSelectMenuDisabled] :: ComponentSelectMenu -> Bool
- Discord.Types: [componentSelectMenuMaxValues] :: ComponentSelectMenu -> Maybe Integer
- Discord.Types: [componentSelectMenuMinValues] :: ComponentSelectMenu -> Maybe Integer
- Discord.Types: [componentSelectMenuOptions] :: ComponentSelectMenu -> [SelectOption]
- Discord.Types: [componentSelectMenuPlaceholder] :: ComponentSelectMenu -> Maybe Text
- Discord.Types: [componentTextInputCustomId] :: ComponentTextInput -> Text
- Discord.Types: [componentTextInputIsParagraph] :: ComponentTextInput -> Bool
- Discord.Types: [componentTextInputLabel] :: ComponentTextInput -> Text
- Discord.Types: [componentTextInputMaxLength] :: ComponentTextInput -> Maybe Integer
- Discord.Types: [componentTextInputMinLength] :: ComponentTextInput -> Maybe Integer
- Discord.Types: [componentTextInputPlaceholder] :: ComponentTextInput -> Text
- Discord.Types: [componentTextInputRequired] :: ComponentTextInput -> Bool
- Discord.Types: [componentTextInputValue] :: ComponentTextInput -> Text
- Discord.Types: data ComponentActionRow
- Discord.Types: data ComponentButton
- Discord.Types: data ComponentSelectMenu
- Discord.Types: data ComponentTextInput
- Discord.Types: mkComponentTextInput :: Text -> Text -> ComponentTextInput
- Discord.Types: type InteractionToken = Text
+ Discord: class Request a
+ Discord.Internal.Rest.Interactions: fromToken :: InteractionToken -> Text
+ Discord.Internal.Types.ApplicationCommands: OptionSubcommand :: Text -> Text -> [OptionValue] -> OptionSubcommand
+ Discord.Internal.Types.ApplicationCommands: OptionSubcommandGroup :: Text -> Text -> [OptionSubcommand] -> OptionSubcommandOrGroup
+ Discord.Internal.Types.ApplicationCommands: OptionSubcommandOrGroupSubcommand :: OptionSubcommand -> OptionSubcommandOrGroup
+ Discord.Internal.Types.ApplicationCommands: OptionValueBoolean :: Text -> Text -> Bool -> OptionValue
+ Discord.Internal.Types.ApplicationCommands: OptionValueChannel :: Text -> Text -> Bool -> Maybe [ApplicationCommandChannelType] -> OptionValue
+ Discord.Internal.Types.ApplicationCommands: OptionValueInteger :: Text -> Text -> Bool -> AutocompleteOrChoice Integer -> Maybe Integer -> Maybe Integer -> OptionValue
+ Discord.Internal.Types.ApplicationCommands: OptionValueMentionable :: Text -> Text -> Bool -> OptionValue
+ Discord.Internal.Types.ApplicationCommands: OptionValueNumber :: Text -> Text -> Bool -> AutocompleteOrChoice Number -> Maybe Number -> Maybe Number -> OptionValue
+ Discord.Internal.Types.ApplicationCommands: OptionValueRole :: Text -> Text -> Bool -> OptionValue
+ Discord.Internal.Types.ApplicationCommands: OptionValueString :: Text -> Text -> Bool -> AutocompleteOrChoice Text -> OptionValue
+ Discord.Internal.Types.ApplicationCommands: OptionValueUser :: Text -> Text -> Bool -> OptionValue
+ Discord.Internal.Types.ApplicationCommands: OptionsSubcommands :: [OptionSubcommandOrGroup] -> Options
+ Discord.Internal.Types.ApplicationCommands: OptionsValues :: [OptionValue] -> Options
+ Discord.Internal.Types.ApplicationCommands: [createDefaultPermission] :: CreateApplicationCommand -> Bool
+ Discord.Internal.Types.ApplicationCommands: [createDescription] :: CreateApplicationCommand -> Text
+ Discord.Internal.Types.ApplicationCommands: [createName] :: CreateApplicationCommand -> Text
+ Discord.Internal.Types.ApplicationCommands: [createOptions] :: CreateApplicationCommand -> Maybe Options
+ Discord.Internal.Types.ApplicationCommands: [editDefaultPermission] :: EditApplicationCommand -> Maybe Bool
+ Discord.Internal.Types.ApplicationCommands: [editDescription] :: EditApplicationCommand -> Maybe Text
+ Discord.Internal.Types.ApplicationCommands: [editName] :: EditApplicationCommand -> Maybe Text
+ Discord.Internal.Types.ApplicationCommands: [editOptions] :: EditApplicationCommand -> Maybe Options
+ Discord.Internal.Types.ApplicationCommands: [optionSubcommandDescription] :: OptionSubcommand -> Text
+ Discord.Internal.Types.ApplicationCommands: [optionSubcommandGroupDescription] :: OptionSubcommandOrGroup -> Text
+ Discord.Internal.Types.ApplicationCommands: [optionSubcommandGroupName] :: OptionSubcommandOrGroup -> Text
+ Discord.Internal.Types.ApplicationCommands: [optionSubcommandGroupOptions] :: OptionSubcommandOrGroup -> [OptionSubcommand]
+ Discord.Internal.Types.ApplicationCommands: [optionSubcommandName] :: OptionSubcommand -> Text
+ Discord.Internal.Types.ApplicationCommands: [optionSubcommandOptions] :: OptionSubcommand -> [OptionValue]
+ Discord.Internal.Types.ApplicationCommands: [optionValueChannelTypes] :: OptionValue -> Maybe [ApplicationCommandChannelType]
+ Discord.Internal.Types.ApplicationCommands: [optionValueDescription] :: OptionValue -> Text
+ Discord.Internal.Types.ApplicationCommands: [optionValueIntegerChoices] :: OptionValue -> AutocompleteOrChoice Integer
+ Discord.Internal.Types.ApplicationCommands: [optionValueIntegerMaxVal] :: OptionValue -> Maybe Integer
+ Discord.Internal.Types.ApplicationCommands: [optionValueIntegerMinVal] :: OptionValue -> Maybe Integer
+ Discord.Internal.Types.ApplicationCommands: [optionValueName] :: OptionValue -> Text
+ Discord.Internal.Types.ApplicationCommands: [optionValueNumberChoices] :: OptionValue -> AutocompleteOrChoice Number
+ Discord.Internal.Types.ApplicationCommands: [optionValueNumberMaxVal] :: OptionValue -> Maybe Number
+ Discord.Internal.Types.ApplicationCommands: [optionValueNumberMinVal] :: OptionValue -> Maybe Number
+ Discord.Internal.Types.ApplicationCommands: [optionValueRequired] :: OptionValue -> Bool
+ Discord.Internal.Types.ApplicationCommands: [optionValueStringChoices] :: OptionValue -> AutocompleteOrChoice Text
+ Discord.Internal.Types.ApplicationCommands: createChatInput :: Text -> Text -> Maybe CreateApplicationCommand
+ Discord.Internal.Types.ApplicationCommands: createMessage :: Text -> Maybe CreateApplicationCommand
+ Discord.Internal.Types.ApplicationCommands: createUser :: Text -> Maybe CreateApplicationCommand
+ Discord.Internal.Types.ApplicationCommands: data OptionSubcommand
+ Discord.Internal.Types.ApplicationCommands: data OptionSubcommandOrGroup
+ Discord.Internal.Types.ApplicationCommands: data OptionValue
+ Discord.Internal.Types.ApplicationCommands: data Options
+ Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.ApplicationCommands.OptionSubcommand
+ Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.ApplicationCommands.OptionSubcommandOrGroup
+ Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.ApplicationCommands.OptionValue
+ Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.ApplicationCommands.Options
+ Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.ApplicationCommands.OptionSubcommand
+ Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.ApplicationCommands.OptionSubcommandOrGroup
+ Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.ApplicationCommands.OptionValue
+ Discord.Internal.Types.ApplicationCommands: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.ApplicationCommands.Options
+ Discord.Internal.Types.ApplicationCommands: instance GHC.Classes.Eq Discord.Internal.Types.ApplicationCommands.OptionSubcommand
+ Discord.Internal.Types.ApplicationCommands: instance GHC.Classes.Eq Discord.Internal.Types.ApplicationCommands.OptionSubcommandOrGroup
+ Discord.Internal.Types.ApplicationCommands: instance GHC.Classes.Eq Discord.Internal.Types.ApplicationCommands.OptionValue
+ Discord.Internal.Types.ApplicationCommands: instance GHC.Classes.Eq Discord.Internal.Types.ApplicationCommands.Options
+ Discord.Internal.Types.ApplicationCommands: instance GHC.Read.Read Discord.Internal.Types.ApplicationCommands.OptionSubcommand
+ Discord.Internal.Types.ApplicationCommands: instance GHC.Read.Read Discord.Internal.Types.ApplicationCommands.OptionSubcommandOrGroup
+ Discord.Internal.Types.ApplicationCommands: instance GHC.Read.Read Discord.Internal.Types.ApplicationCommands.OptionValue
+ Discord.Internal.Types.ApplicationCommands: instance GHC.Read.Read Discord.Internal.Types.ApplicationCommands.Options
+ Discord.Internal.Types.ApplicationCommands: instance GHC.Show.Show Discord.Internal.Types.ApplicationCommands.OptionSubcommand
+ Discord.Internal.Types.ApplicationCommands: instance GHC.Show.Show Discord.Internal.Types.ApplicationCommands.OptionSubcommandOrGroup
+ Discord.Internal.Types.ApplicationCommands: instance GHC.Show.Show Discord.Internal.Types.ApplicationCommands.OptionValue
+ Discord.Internal.Types.ApplicationCommands: instance GHC.Show.Show Discord.Internal.Types.ApplicationCommands.Options
+ Discord.Internal.Types.ApplicationCommands: type Number = Scientific
+ Discord.Internal.Types.Components: ActionRowButtons :: [Button] -> ActionRow
+ Discord.Internal.Types.Components: ActionRowSelectMenu :: SelectMenu -> ActionRow
+ Discord.Internal.Types.Components: Button :: Text -> Bool -> ButtonStyle -> Maybe Text -> Maybe Emoji -> Button
+ Discord.Internal.Types.Components: ButtonUrl :: Text -> Bool -> Maybe Text -> Maybe Emoji -> Button
+ Discord.Internal.Types.Components: SelectMenu :: Text -> Bool -> [SelectOption] -> Maybe Text -> Maybe Integer -> Maybe Integer -> SelectMenu
+ Discord.Internal.Types.Components: TextInput :: Text -> Bool -> Text -> Maybe Integer -> Maybe Integer -> Bool -> Text -> Text -> TextInput
+ Discord.Internal.Types.Components: [buttonCustomId] :: Button -> Text
+ Discord.Internal.Types.Components: [buttonDisabled] :: Button -> Bool
+ Discord.Internal.Types.Components: [buttonEmoji] :: Button -> Maybe Emoji
+ Discord.Internal.Types.Components: [buttonLabel] :: Button -> Maybe Text
+ Discord.Internal.Types.Components: [buttonStyle] :: Button -> ButtonStyle
+ Discord.Internal.Types.Components: [buttonUrl] :: Button -> Text
+ Discord.Internal.Types.Components: [selectMenuCustomId] :: SelectMenu -> Text
+ Discord.Internal.Types.Components: [selectMenuDisabled] :: SelectMenu -> Bool
+ Discord.Internal.Types.Components: [selectMenuMaxValues] :: SelectMenu -> Maybe Integer
+ Discord.Internal.Types.Components: [selectMenuMinValues] :: SelectMenu -> Maybe Integer
+ Discord.Internal.Types.Components: [selectMenuOptions] :: SelectMenu -> [SelectOption]
+ Discord.Internal.Types.Components: [selectMenuPlaceholder] :: SelectMenu -> Maybe Text
+ Discord.Internal.Types.Components: [textInputCustomId] :: TextInput -> Text
+ Discord.Internal.Types.Components: [textInputIsParagraph] :: TextInput -> Bool
+ Discord.Internal.Types.Components: [textInputLabel] :: TextInput -> Text
+ Discord.Internal.Types.Components: [textInputMaxLength] :: TextInput -> Maybe Integer
+ Discord.Internal.Types.Components: [textInputMinLength] :: TextInput -> Maybe Integer
+ Discord.Internal.Types.Components: [textInputPlaceholder] :: TextInput -> Text
+ Discord.Internal.Types.Components: [textInputRequired] :: TextInput -> Bool
+ Discord.Internal.Types.Components: [textInputValue] :: TextInput -> Text
+ Discord.Internal.Types.Components: data ActionRow
+ Discord.Internal.Types.Components: data Button
+ Discord.Internal.Types.Components: data SelectMenu
+ Discord.Internal.Types.Components: data TextInput
+ Discord.Internal.Types.Components: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Components.ActionRow
+ Discord.Internal.Types.Components: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Components.Button
+ Discord.Internal.Types.Components: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Components.SelectMenu
+ Discord.Internal.Types.Components: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Components.TextInput
+ Discord.Internal.Types.Components: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.Components.ActionRow
+ Discord.Internal.Types.Components: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.Components.Button
+ Discord.Internal.Types.Components: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.Components.SelectMenu
+ Discord.Internal.Types.Components: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.Components.TextInput
+ Discord.Internal.Types.Components: instance GHC.Classes.Eq Discord.Internal.Types.Components.ActionRow
+ Discord.Internal.Types.Components: instance GHC.Classes.Eq Discord.Internal.Types.Components.Button
+ Discord.Internal.Types.Components: instance GHC.Classes.Eq Discord.Internal.Types.Components.SelectMenu
+ Discord.Internal.Types.Components: instance GHC.Classes.Eq Discord.Internal.Types.Components.TextInput
+ Discord.Internal.Types.Components: instance GHC.Classes.Ord Discord.Internal.Types.Components.ActionRow
+ Discord.Internal.Types.Components: instance GHC.Classes.Ord Discord.Internal.Types.Components.Button
+ Discord.Internal.Types.Components: instance GHC.Classes.Ord Discord.Internal.Types.Components.SelectMenu
+ Discord.Internal.Types.Components: instance GHC.Classes.Ord Discord.Internal.Types.Components.TextInput
+ Discord.Internal.Types.Components: instance GHC.Read.Read Discord.Internal.Types.Components.ActionRow
+ Discord.Internal.Types.Components: instance GHC.Read.Read Discord.Internal.Types.Components.Button
+ Discord.Internal.Types.Components: instance GHC.Read.Read Discord.Internal.Types.Components.SelectMenu
+ Discord.Internal.Types.Components: instance GHC.Read.Read Discord.Internal.Types.Components.TextInput
+ Discord.Internal.Types.Components: instance GHC.Show.Show Discord.Internal.Types.Components.ActionRow
+ Discord.Internal.Types.Components: instance GHC.Show.Show Discord.Internal.Types.Components.Button
+ Discord.Internal.Types.Components: instance GHC.Show.Show Discord.Internal.Types.Components.SelectMenu
+ Discord.Internal.Types.Components: instance GHC.Show.Show Discord.Internal.Types.Components.TextInput
+ Discord.Internal.Types.Components: mkTextInput :: Text -> Text -> TextInput
+ Discord.Internal.Types.Interactions: ApplicationCommandDataChatInput :: ApplicationCommandId -> Text -> Maybe ResolvedData -> Maybe OptionsData -> ApplicationCommandData
+ Discord.Internal.Types.Interactions: ApplicationCommandDataMessage :: ApplicationCommandId -> Text -> Maybe ResolvedData -> MessageId -> ApplicationCommandData
+ Discord.Internal.Types.Interactions: ApplicationCommandDataUser :: ApplicationCommandId -> Text -> Maybe ResolvedData -> UserId -> ApplicationCommandData
+ Discord.Internal.Types.Interactions: ButtonData :: Text -> ComponentData
+ Discord.Internal.Types.Interactions: OptionDataSubcommand :: Text -> [OptionDataValue] -> Bool -> OptionDataSubcommand
+ Discord.Internal.Types.Interactions: OptionDataSubcommandGroup :: Text -> [OptionDataSubcommand] -> Bool -> OptionDataSubcommandOrGroup
+ Discord.Internal.Types.Interactions: OptionDataSubcommandOrGroupSubcommand :: OptionDataSubcommand -> OptionDataSubcommandOrGroup
+ Discord.Internal.Types.Interactions: OptionDataValueBoolean :: Text -> Bool -> OptionDataValue
+ Discord.Internal.Types.Interactions: OptionDataValueChannel :: Text -> ChannelId -> OptionDataValue
+ Discord.Internal.Types.Interactions: OptionDataValueInteger :: Text -> Either Text Integer -> OptionDataValue
+ Discord.Internal.Types.Interactions: OptionDataValueMentionable :: Text -> Snowflake -> OptionDataValue
+ Discord.Internal.Types.Interactions: OptionDataValueNumber :: Text -> Either Text Number -> OptionDataValue
+ Discord.Internal.Types.Interactions: OptionDataValueRole :: Text -> RoleId -> OptionDataValue
+ Discord.Internal.Types.Interactions: OptionDataValueString :: Text -> Either Text Text -> OptionDataValue
+ Discord.Internal.Types.Interactions: OptionDataValueUser :: Text -> UserId -> OptionDataValue
+ Discord.Internal.Types.Interactions: OptionsDataSubcommands :: [OptionDataSubcommandOrGroup] -> OptionsData
+ Discord.Internal.Types.Interactions: OptionsDataValues :: [OptionDataValue] -> OptionsData
+ Discord.Internal.Types.Interactions: SelectMenuData :: Text -> [Text] -> ComponentData
+ Discord.Internal.Types.Interactions: [applicationCommandDataId] :: ApplicationCommandData -> ApplicationCommandId
+ Discord.Internal.Types.Interactions: [applicationCommandDataName] :: ApplicationCommandData -> Text
+ Discord.Internal.Types.Interactions: [applicationCommandDataTargetMessageId] :: ApplicationCommandData -> MessageId
+ Discord.Internal.Types.Interactions: [applicationCommandDataTargetUserId] :: ApplicationCommandData -> UserId
+ Discord.Internal.Types.Interactions: [applicationCommandData] :: Interaction -> ApplicationCommandData
+ Discord.Internal.Types.Interactions: [componentDataCustomId] :: ComponentData -> Text
+ Discord.Internal.Types.Interactions: [componentDataValues] :: ComponentData -> [Text]
+ Discord.Internal.Types.Interactions: [componentData] :: Interaction -> ComponentData
+ Discord.Internal.Types.Interactions: [modalData] :: Interaction -> ModalData
+ Discord.Internal.Types.Interactions: [optionDataSubcommandFocused] :: OptionDataSubcommand -> Bool
+ Discord.Internal.Types.Interactions: [optionDataSubcommandGroupFocused] :: OptionDataSubcommandOrGroup -> Bool
+ Discord.Internal.Types.Interactions: [optionDataSubcommandGroupName] :: OptionDataSubcommandOrGroup -> Text
+ Discord.Internal.Types.Interactions: [optionDataSubcommandGroupOptions] :: OptionDataSubcommandOrGroup -> [OptionDataSubcommand]
+ Discord.Internal.Types.Interactions: [optionDataSubcommandName] :: OptionDataSubcommand -> Text
+ Discord.Internal.Types.Interactions: [optionDataSubcommandOptions] :: OptionDataSubcommand -> [OptionDataValue]
+ Discord.Internal.Types.Interactions: [optionDataValueBoolean] :: OptionDataValue -> Bool
+ Discord.Internal.Types.Interactions: [optionDataValueChannel] :: OptionDataValue -> ChannelId
+ Discord.Internal.Types.Interactions: [optionDataValueInteger] :: OptionDataValue -> Either Text Integer
+ Discord.Internal.Types.Interactions: [optionDataValueMentionable] :: OptionDataValue -> Snowflake
+ Discord.Internal.Types.Interactions: [optionDataValueName] :: OptionDataValue -> Text
+ Discord.Internal.Types.Interactions: [optionDataValueNumber] :: OptionDataValue -> Either Text Number
+ Discord.Internal.Types.Interactions: [optionDataValueRole] :: OptionDataValue -> RoleId
+ Discord.Internal.Types.Interactions: [optionDataValueString] :: OptionDataValue -> Either Text Text
+ Discord.Internal.Types.Interactions: [optionDataValueUser] :: OptionDataValue -> UserId
+ Discord.Internal.Types.Interactions: [optionsData] :: ApplicationCommandData -> Maybe OptionsData
+ Discord.Internal.Types.Interactions: [resolvedData] :: ApplicationCommandData -> Maybe ResolvedData
+ Discord.Internal.Types.Interactions: data ApplicationCommandData
+ Discord.Internal.Types.Interactions: data ComponentData
+ Discord.Internal.Types.Interactions: data InteractionToken
+ Discord.Internal.Types.Interactions: data OptionDataSubcommand
+ Discord.Internal.Types.Interactions: data OptionDataSubcommandOrGroup
+ Discord.Internal.Types.Interactions: data OptionDataValue
+ Discord.Internal.Types.Interactions: data OptionsData
+ Discord.Internal.Types.Interactions: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Interactions.ApplicationCommandData
+ Discord.Internal.Types.Interactions: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Interactions.ComponentData
+ Discord.Internal.Types.Interactions: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Interactions.ModalData
+ Discord.Internal.Types.Interactions: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Interactions.OptionDataSubcommand
+ Discord.Internal.Types.Interactions: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Interactions.OptionDataSubcommandOrGroup
+ Discord.Internal.Types.Interactions: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Interactions.OptionDataValue
+ Discord.Internal.Types.Interactions: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Interactions.OptionsData
+ Discord.Internal.Types.Interactions: instance GHC.Classes.Eq Discord.Internal.Types.Interactions.ApplicationCommandData
+ Discord.Internal.Types.Interactions: instance GHC.Classes.Eq Discord.Internal.Types.Interactions.ComponentData
+ Discord.Internal.Types.Interactions: instance GHC.Classes.Eq Discord.Internal.Types.Interactions.ModalData
+ Discord.Internal.Types.Interactions: instance GHC.Classes.Eq Discord.Internal.Types.Interactions.OptionDataSubcommand
+ Discord.Internal.Types.Interactions: instance GHC.Classes.Eq Discord.Internal.Types.Interactions.OptionDataSubcommandOrGroup
+ Discord.Internal.Types.Interactions: instance GHC.Classes.Eq Discord.Internal.Types.Interactions.OptionDataValue
+ Discord.Internal.Types.Interactions: instance GHC.Classes.Eq Discord.Internal.Types.Interactions.OptionsData
+ Discord.Internal.Types.Interactions: instance GHC.Classes.Ord Discord.Internal.Types.Interactions.ApplicationCommandData
+ Discord.Internal.Types.Interactions: instance GHC.Classes.Ord Discord.Internal.Types.Interactions.ComponentData
+ Discord.Internal.Types.Interactions: instance GHC.Classes.Ord Discord.Internal.Types.Interactions.ModalData
+ Discord.Internal.Types.Interactions: instance GHC.Classes.Ord Discord.Internal.Types.Interactions.OptionDataSubcommand
+ Discord.Internal.Types.Interactions: instance GHC.Classes.Ord Discord.Internal.Types.Interactions.OptionDataSubcommandOrGroup
+ Discord.Internal.Types.Interactions: instance GHC.Classes.Ord Discord.Internal.Types.Interactions.OptionDataValue
+ Discord.Internal.Types.Interactions: instance GHC.Classes.Ord Discord.Internal.Types.Interactions.OptionsData
+ Discord.Internal.Types.Interactions: instance GHC.Read.Read Discord.Internal.Types.Interactions.ApplicationCommandData
+ Discord.Internal.Types.Interactions: instance GHC.Read.Read Discord.Internal.Types.Interactions.ComponentData
+ Discord.Internal.Types.Interactions: instance GHC.Read.Read Discord.Internal.Types.Interactions.ModalData
+ Discord.Internal.Types.Interactions: instance GHC.Read.Read Discord.Internal.Types.Interactions.OptionDataSubcommand
+ Discord.Internal.Types.Interactions: instance GHC.Read.Read Discord.Internal.Types.Interactions.OptionDataSubcommandOrGroup
+ Discord.Internal.Types.Interactions: instance GHC.Read.Read Discord.Internal.Types.Interactions.OptionDataValue
+ Discord.Internal.Types.Interactions: instance GHC.Read.Read Discord.Internal.Types.Interactions.OptionsData
+ Discord.Internal.Types.Interactions: instance GHC.Show.Show Discord.Internal.Types.Interactions.ApplicationCommandData
+ Discord.Internal.Types.Interactions: instance GHC.Show.Show Discord.Internal.Types.Interactions.ComponentData
+ Discord.Internal.Types.Interactions: instance GHC.Show.Show Discord.Internal.Types.Interactions.ModalData
+ Discord.Internal.Types.Interactions: instance GHC.Show.Show Discord.Internal.Types.Interactions.OptionDataSubcommand
+ Discord.Internal.Types.Interactions: instance GHC.Show.Show Discord.Internal.Types.Interactions.OptionDataSubcommandOrGroup
+ Discord.Internal.Types.Interactions: instance GHC.Show.Show Discord.Internal.Types.Interactions.OptionDataValue
+ Discord.Internal.Types.Interactions: instance GHC.Show.Show Discord.Internal.Types.Interactions.OptionsData
+ Discord.Internal.Types.Prelude: DiscordId :: Snowflake -> DiscordId a
+ Discord.Internal.Types.Prelude: InteractionToken :: Text -> InteractionToken
+ Discord.Internal.Types.Prelude: [unId] :: DiscordId a -> Snowflake
+ Discord.Internal.Types.Prelude: [unSnowflake] :: Snowflake -> Word64
+ Discord.Internal.Types.Prelude: data ApplicationCommandIdType
+ Discord.Internal.Types.Prelude: data ApplicationIdType
+ Discord.Internal.Types.Prelude: data AttachmentIdType
+ Discord.Internal.Types.Prelude: data ChannelIdType
+ Discord.Internal.Types.Prelude: data EmojiIdType
+ Discord.Internal.Types.Prelude: data GuildIdType
+ Discord.Internal.Types.Prelude: data IntegrationIdType
+ Discord.Internal.Types.Prelude: data InteractionIdType
+ Discord.Internal.Types.Prelude: data MessageIdType
+ Discord.Internal.Types.Prelude: data OverwriteIdType
+ Discord.Internal.Types.Prelude: data ParentIdType
+ Discord.Internal.Types.Prelude: data RoleIdType
+ Discord.Internal.Types.Prelude: data ScheduledEventEntityIdType
+ Discord.Internal.Types.Prelude: data ScheduledEventIdType
+ Discord.Internal.Types.Prelude: data StageIdType
+ Discord.Internal.Types.Prelude: data StickerIdType
+ Discord.Internal.Types.Prelude: data UserIdType
+ Discord.Internal.Types.Prelude: data WebhookIdType
+ Discord.Internal.Types.Prelude: instance Data.Aeson.Types.FromJSON.FromJSON (Discord.Internal.Types.Prelude.DiscordId a)
+ Discord.Internal.Types.Prelude: instance Data.Aeson.Types.FromJSON.FromJSON Discord.Internal.Types.Prelude.InteractionToken
+ Discord.Internal.Types.Prelude: instance Data.Aeson.Types.ToJSON.ToJSON (Discord.Internal.Types.Prelude.DiscordId a)
+ Discord.Internal.Types.Prelude: instance Data.Aeson.Types.ToJSON.ToJSON Discord.Internal.Types.Prelude.InteractionToken
+ Discord.Internal.Types.Prelude: instance Data.Bits.Bits (Discord.Internal.Types.Prelude.DiscordId a)
+ Discord.Internal.Types.Prelude: instance GHC.Classes.Eq (Discord.Internal.Types.Prelude.DiscordId a)
+ Discord.Internal.Types.Prelude: instance GHC.Classes.Eq Discord.Internal.Types.Prelude.InteractionToken
+ Discord.Internal.Types.Prelude: instance GHC.Classes.Ord (Discord.Internal.Types.Prelude.DiscordId a)
+ Discord.Internal.Types.Prelude: instance GHC.Classes.Ord Discord.Internal.Types.Prelude.InteractionToken
+ Discord.Internal.Types.Prelude: instance GHC.Enum.Enum (Discord.Internal.Types.Prelude.DiscordId a)
+ Discord.Internal.Types.Prelude: instance GHC.Num.Num (Discord.Internal.Types.Prelude.DiscordId a)
+ Discord.Internal.Types.Prelude: instance GHC.Read.Read (Discord.Internal.Types.Prelude.DiscordId a)
+ Discord.Internal.Types.Prelude: instance GHC.Read.Read Discord.Internal.Types.Prelude.InteractionToken
+ Discord.Internal.Types.Prelude: instance GHC.Real.Integral (Discord.Internal.Types.Prelude.DiscordId a)
+ Discord.Internal.Types.Prelude: instance GHC.Real.Real (Discord.Internal.Types.Prelude.DiscordId a)
+ Discord.Internal.Types.Prelude: instance GHC.Show.Show (Discord.Internal.Types.Prelude.DiscordId a)
+ Discord.Internal.Types.Prelude: instance GHC.Show.Show Discord.Internal.Types.Prelude.InteractionToken
+ Discord.Internal.Types.Prelude: newtype DiscordId a
+ Discord.Internal.Types.Prelude: newtype InteractionToken
+ Discord.Types: ActionRowButtons :: [Button] -> ActionRow
+ Discord.Types: ActionRowSelectMenu :: SelectMenu -> ActionRow
+ Discord.Types: Button :: Text -> Bool -> ButtonStyle -> Maybe Text -> Maybe Emoji -> Button
+ Discord.Types: ButtonUrl :: Text -> Bool -> Maybe Text -> Maybe Emoji -> Button
+ Discord.Types: DiscordId :: Snowflake -> DiscordId a
+ Discord.Types: InteractionToken :: Text -> InteractionToken
+ Discord.Types: SelectMenu :: Text -> Bool -> [SelectOption] -> Maybe Text -> Maybe Integer -> Maybe Integer -> SelectMenu
+ Discord.Types: TextInput :: Text -> Bool -> Text -> Maybe Integer -> Maybe Integer -> Bool -> Text -> Text -> TextInput
+ Discord.Types: [buttonCustomId] :: Button -> Text
+ Discord.Types: [buttonDisabled] :: Button -> Bool
+ Discord.Types: [buttonEmoji] :: Button -> Maybe Emoji
+ Discord.Types: [buttonLabel] :: Button -> Maybe Text
+ Discord.Types: [buttonStyle] :: Button -> ButtonStyle
+ Discord.Types: [buttonUrl] :: Button -> Text
+ Discord.Types: [selectMenuCustomId] :: SelectMenu -> Text
+ Discord.Types: [selectMenuDisabled] :: SelectMenu -> Bool
+ Discord.Types: [selectMenuMaxValues] :: SelectMenu -> Maybe Integer
+ Discord.Types: [selectMenuMinValues] :: SelectMenu -> Maybe Integer
+ Discord.Types: [selectMenuOptions] :: SelectMenu -> [SelectOption]
+ Discord.Types: [selectMenuPlaceholder] :: SelectMenu -> Maybe Text
+ Discord.Types: [textInputCustomId] :: TextInput -> Text
+ Discord.Types: [textInputIsParagraph] :: TextInput -> Bool
+ Discord.Types: [textInputLabel] :: TextInput -> Text
+ Discord.Types: [textInputMaxLength] :: TextInput -> Maybe Integer
+ Discord.Types: [textInputMinLength] :: TextInput -> Maybe Integer
+ Discord.Types: [textInputPlaceholder] :: TextInput -> Text
+ Discord.Types: [textInputRequired] :: TextInput -> Bool
+ Discord.Types: [textInputValue] :: TextInput -> Text
+ Discord.Types: [unId] :: DiscordId a -> Snowflake
+ Discord.Types: [unSnowflake] :: Snowflake -> Word64
+ Discord.Types: data ActionRow
+ Discord.Types: data ApplicationCommandIdType
+ Discord.Types: data ApplicationIdType
+ Discord.Types: data AttachmentIdType
+ Discord.Types: data Button
+ Discord.Types: data ChannelIdType
+ Discord.Types: data EmojiIdType
+ Discord.Types: data GuildIdType
+ Discord.Types: data IntegrationIdType
+ Discord.Types: data InteractionIdType
+ Discord.Types: data MessageIdType
+ Discord.Types: data OverwriteIdType
+ Discord.Types: data ParentIdType
+ Discord.Types: data RoleIdType
+ Discord.Types: data ScheduledEventEntityIdType
+ Discord.Types: data ScheduledEventIdType
+ Discord.Types: data SelectMenu
+ Discord.Types: data StageIdType
+ Discord.Types: data StickerIdType
+ Discord.Types: data TextInput
+ Discord.Types: data UserIdType
+ Discord.Types: data WebhookIdType
+ Discord.Types: mkTextInput :: Text -> Text -> TextInput
+ Discord.Types: newtype DiscordId a
+ Discord.Types: newtype InteractionToken
- Discord: restCall :: (FromJSON a, Request (r a)) => r a -> DiscordHandler (Either RestCallErrorCode a)
+ Discord: restCall :: (Request (r a), FromJSON a) => r a -> DiscordHandler (Either RestCallErrorCode a)
- Discord.Internal.Rest.Channel: MessageDetailedOpts :: Text -> Bool -> Maybe [CreateEmbed] -> Maybe (Text, ByteString) -> Maybe AllowedMentions -> Maybe MessageReference -> Maybe [ComponentActionRow] -> Maybe [StickerId] -> MessageDetailedOpts
+ Discord.Internal.Rest.Channel: MessageDetailedOpts :: Text -> Bool -> Maybe [CreateEmbed] -> Maybe (Text, ByteString) -> Maybe AllowedMentions -> Maybe MessageReference -> Maybe [ActionRow] -> Maybe [StickerId] -> MessageDetailedOpts
- Discord.Internal.Rest.Channel: [messageDetailedComponents] :: MessageDetailedOpts -> Maybe [ComponentActionRow]
+ Discord.Internal.Rest.Channel: [messageDetailedComponents] :: MessageDetailedOpts -> Maybe [ActionRow]
- Discord.Internal.Types.ApplicationCommands: ApplicationCommandChatInput :: ApplicationCommandId -> ApplicationId -> Maybe GuildId -> Text -> Text -> Maybe ApplicationCommandOptions -> Bool -> Snowflake -> ApplicationCommand
+ Discord.Internal.Types.ApplicationCommands: ApplicationCommandChatInput :: ApplicationCommandId -> ApplicationId -> Maybe GuildId -> Text -> Text -> Maybe Options -> Bool -> Snowflake -> ApplicationCommand
- Discord.Internal.Types.ApplicationCommands: CreateApplicationCommandChatInput :: Text -> Text -> Maybe ApplicationCommandOptions -> Bool -> CreateApplicationCommand
+ Discord.Internal.Types.ApplicationCommands: CreateApplicationCommandChatInput :: Text -> Text -> Maybe Options -> Bool -> CreateApplicationCommand
- Discord.Internal.Types.ApplicationCommands: EditApplicationCommandChatInput :: Maybe Text -> Maybe Text -> Maybe ApplicationCommandOptions -> Maybe Bool -> EditApplicationCommand
+ Discord.Internal.Types.ApplicationCommands: EditApplicationCommandChatInput :: Maybe Text -> Maybe Text -> Maybe Options -> Maybe Bool -> EditApplicationCommand
- Discord.Internal.Types.ApplicationCommands: [applicationCommandOptions] :: ApplicationCommand -> Maybe ApplicationCommandOptions
+ Discord.Internal.Types.ApplicationCommands: [applicationCommandOptions] :: ApplicationCommand -> Maybe Options
- Discord.Internal.Types.Channel: Message :: MessageId -> ChannelId -> Maybe GuildId -> User -> Maybe GuildMember -> Text -> UTCTime -> Maybe UTCTime -> Bool -> Bool -> [User] -> [RoleId] -> [Attachment] -> [Embed] -> [MessageReaction] -> Maybe Nonce -> Bool -> Maybe WebhookId -> MessageType -> Maybe MessageActivity -> Maybe ApplicationId -> Maybe MessageReference -> Maybe MessageFlags -> Maybe Message -> Maybe MessageInteraction -> Maybe Channel -> Maybe [ComponentActionRow] -> Maybe [StickerItem] -> Message
+ Discord.Internal.Types.Channel: Message :: MessageId -> ChannelId -> Maybe GuildId -> User -> Maybe GuildMember -> Text -> UTCTime -> Maybe UTCTime -> Bool -> Bool -> [User] -> [RoleId] -> [Attachment] -> [Embed] -> [MessageReaction] -> Maybe Nonce -> Bool -> Maybe WebhookId -> MessageType -> Maybe MessageActivity -> Maybe ApplicationId -> Maybe MessageReference -> Maybe MessageFlags -> Maybe Message -> Maybe MessageInteraction -> Maybe Channel -> Maybe [ActionRow] -> Maybe [StickerItem] -> Message
- Discord.Internal.Types.Channel: [messageComponents] :: Message -> Maybe [ComponentActionRow]
+ Discord.Internal.Types.Channel: [messageComponents] :: Message -> Maybe [ActionRow]
- Discord.Internal.Types.Components: mkButton :: Text -> Text -> ComponentButton
+ Discord.Internal.Types.Components: mkButton :: Text -> Text -> Button
- Discord.Internal.Types.Components: mkSelectMenu :: Text -> [SelectOption] -> ComponentSelectMenu
+ Discord.Internal.Types.Components: mkSelectMenu :: Text -> [SelectOption] -> SelectMenu
- Discord.Internal.Types.Interactions: InteractionApplicationCommand :: InteractionId -> ApplicationId -> InteractionDataApplicationCommand -> Maybe GuildId -> Maybe ChannelId -> MemberOrUser -> InteractionToken -> Int -> Text -> Maybe Text -> Interaction
+ Discord.Internal.Types.Interactions: InteractionApplicationCommand :: InteractionId -> ApplicationId -> ApplicationCommandData -> Maybe GuildId -> Maybe ChannelId -> MemberOrUser -> InteractionToken -> Int -> Text -> Maybe Text -> Interaction
- Discord.Internal.Types.Interactions: InteractionApplicationCommandAutocomplete :: InteractionId -> ApplicationId -> InteractionDataApplicationCommand -> Maybe GuildId -> Maybe ChannelId -> MemberOrUser -> InteractionToken -> Int -> Text -> Maybe Text -> Interaction
+ Discord.Internal.Types.Interactions: InteractionApplicationCommandAutocomplete :: InteractionId -> ApplicationId -> ApplicationCommandData -> Maybe GuildId -> Maybe ChannelId -> MemberOrUser -> InteractionToken -> Int -> Text -> Maybe Text -> Interaction
- Discord.Internal.Types.Interactions: InteractionComponent :: InteractionId -> ApplicationId -> InteractionDataComponent -> Maybe GuildId -> Maybe ChannelId -> MemberOrUser -> InteractionToken -> Int -> Message -> Text -> Maybe Text -> Interaction
+ Discord.Internal.Types.Interactions: InteractionComponent :: InteractionId -> ApplicationId -> ComponentData -> Maybe GuildId -> Maybe ChannelId -> MemberOrUser -> InteractionToken -> Int -> Message -> Text -> Maybe Text -> Interaction
- Discord.Internal.Types.Interactions: InteractionModalSubmit :: InteractionId -> ApplicationId -> InteractionDataModal -> Maybe GuildId -> Maybe ChannelId -> MemberOrUser -> InteractionToken -> Int -> Text -> Maybe Text -> Interaction
+ Discord.Internal.Types.Interactions: InteractionModalSubmit :: InteractionId -> ApplicationId -> ModalData -> Maybe GuildId -> Maybe ChannelId -> MemberOrUser -> InteractionToken -> Int -> Text -> Maybe Text -> Interaction
- Discord.Internal.Types.Interactions: InteractionResponseAutocompleteNumber :: [Choice Scientific] -> InteractionResponseAutocomplete
+ Discord.Internal.Types.Interactions: InteractionResponseAutocompleteNumber :: [Choice Number] -> InteractionResponseAutocomplete
- Discord.Internal.Types.Interactions: InteractionResponseMessage :: Maybe Bool -> Maybe Text -> Maybe [CreateEmbed] -> Maybe AllowedMentions -> Maybe InteractionResponseMessageFlags -> Maybe [ComponentActionRow] -> Maybe [Attachment] -> InteractionResponseMessage
+ Discord.Internal.Types.Interactions: InteractionResponseMessage :: Maybe Bool -> Maybe Text -> Maybe [CreateEmbed] -> Maybe AllowedMentions -> Maybe InteractionResponseMessageFlags -> Maybe [ActionRow] -> Maybe [Attachment] -> InteractionResponseMessage
- Discord.Internal.Types.Interactions: InteractionResponseModalData :: Text -> Text -> [ComponentTextInput] -> InteractionResponseModalData
+ Discord.Internal.Types.Interactions: InteractionResponseModalData :: Text -> Text -> [TextInput] -> InteractionResponseModalData
- Discord.Internal.Types.Interactions: [interactionResponseMessageComponents] :: InteractionResponseMessage -> Maybe [ComponentActionRow]
+ Discord.Internal.Types.Interactions: [interactionResponseMessageComponents] :: InteractionResponseMessage -> Maybe [ActionRow]
- Discord.Internal.Types.Interactions: [interactionResponseModalComponents] :: InteractionResponseModalData -> [ComponentTextInput]
+ Discord.Internal.Types.Interactions: [interactionResponseModalComponents] :: InteractionResponseModalData -> [TextInput]
- Discord.Internal.Types.Prelude: type ApplicationCommandId = Snowflake
+ Discord.Internal.Types.Prelude: type ApplicationCommandId = DiscordId ApplicationCommandIdType
- Discord.Internal.Types.Prelude: type ApplicationId = Snowflake
+ Discord.Internal.Types.Prelude: type ApplicationId = DiscordId ApplicationIdType
- Discord.Internal.Types.Prelude: type AttachmentId = Snowflake
+ Discord.Internal.Types.Prelude: type AttachmentId = DiscordId AttachmentIdType
- Discord.Internal.Types.Prelude: type ChannelId = Snowflake
+ Discord.Internal.Types.Prelude: type ChannelId = DiscordId ChannelIdType
- Discord.Internal.Types.Prelude: type EmojiId = Snowflake
+ Discord.Internal.Types.Prelude: type EmojiId = DiscordId EmojiIdType
- Discord.Internal.Types.Prelude: type GuildId = Snowflake
+ Discord.Internal.Types.Prelude: type GuildId = DiscordId GuildIdType
- Discord.Internal.Types.Prelude: type IntegrationId = Snowflake
+ Discord.Internal.Types.Prelude: type IntegrationId = DiscordId IntegrationIdType
- Discord.Internal.Types.Prelude: type InteractionId = Snowflake
+ Discord.Internal.Types.Prelude: type InteractionId = DiscordId InteractionIdType
- Discord.Internal.Types.Prelude: type MessageId = Snowflake
+ Discord.Internal.Types.Prelude: type MessageId = DiscordId MessageIdType
- Discord.Internal.Types.Prelude: type OverwriteId = Snowflake
+ Discord.Internal.Types.Prelude: type OverwriteId = DiscordId OverwriteIdType
- Discord.Internal.Types.Prelude: type ParentId = Snowflake
+ Discord.Internal.Types.Prelude: type ParentId = DiscordId ParentIdType
- Discord.Internal.Types.Prelude: type RoleId = Snowflake
+ Discord.Internal.Types.Prelude: type RoleId = DiscordId RoleIdType
- Discord.Internal.Types.Prelude: type ScheduledEventEntityId = Snowflake
+ Discord.Internal.Types.Prelude: type ScheduledEventEntityId = DiscordId ScheduledEventEntityIdType
- Discord.Internal.Types.Prelude: type ScheduledEventId = Snowflake
+ Discord.Internal.Types.Prelude: type ScheduledEventId = DiscordId ScheduledEventIdType
- Discord.Internal.Types.Prelude: type StageId = Snowflake
+ Discord.Internal.Types.Prelude: type StageId = DiscordId StageIdType
- Discord.Internal.Types.Prelude: type StickerId = Snowflake
+ Discord.Internal.Types.Prelude: type StickerId = DiscordId StickerIdType
- Discord.Internal.Types.Prelude: type UserId = Snowflake
+ Discord.Internal.Types.Prelude: type UserId = DiscordId UserIdType
- Discord.Internal.Types.Prelude: type WebhookId = Snowflake
+ Discord.Internal.Types.Prelude: type WebhookId = DiscordId WebhookIdType
- Discord.Types: Message :: MessageId -> ChannelId -> Maybe GuildId -> User -> Maybe GuildMember -> Text -> UTCTime -> Maybe UTCTime -> Bool -> Bool -> [User] -> [RoleId] -> [Attachment] -> [Embed] -> [MessageReaction] -> Maybe Nonce -> Bool -> Maybe WebhookId -> MessageType -> Maybe MessageActivity -> Maybe ApplicationId -> Maybe MessageReference -> Maybe MessageFlags -> Maybe Message -> Maybe MessageInteraction -> Maybe Channel -> Maybe [ComponentActionRow] -> Maybe [StickerItem] -> Message
+ Discord.Types: Message :: MessageId -> ChannelId -> Maybe GuildId -> User -> Maybe GuildMember -> Text -> UTCTime -> Maybe UTCTime -> Bool -> Bool -> [User] -> [RoleId] -> [Attachment] -> [Embed] -> [MessageReaction] -> Maybe Nonce -> Bool -> Maybe WebhookId -> MessageType -> Maybe MessageActivity -> Maybe ApplicationId -> Maybe MessageReference -> Maybe MessageFlags -> Maybe Message -> Maybe MessageInteraction -> Maybe Channel -> Maybe [ActionRow] -> Maybe [StickerItem] -> Message
- Discord.Types: [messageComponents] :: Message -> Maybe [ComponentActionRow]
+ Discord.Types: [messageComponents] :: Message -> Maybe [ActionRow]
- Discord.Types: mkButton :: Text -> Text -> ComponentButton
+ Discord.Types: mkButton :: Text -> Text -> Button
- Discord.Types: mkSelectMenu :: Text -> [SelectOption] -> ComponentSelectMenu
+ Discord.Types: mkSelectMenu :: Text -> [SelectOption] -> SelectMenu
- Discord.Types: type ApplicationCommandId = Snowflake
+ Discord.Types: type ApplicationCommandId = DiscordId ApplicationCommandIdType
- Discord.Types: type ApplicationId = Snowflake
+ Discord.Types: type ApplicationId = DiscordId ApplicationIdType
- Discord.Types: type AttachmentId = Snowflake
+ Discord.Types: type AttachmentId = DiscordId AttachmentIdType
- Discord.Types: type ChannelId = Snowflake
+ Discord.Types: type ChannelId = DiscordId ChannelIdType
- Discord.Types: type EmojiId = Snowflake
+ Discord.Types: type EmojiId = DiscordId EmojiIdType
- Discord.Types: type GuildId = Snowflake
+ Discord.Types: type GuildId = DiscordId GuildIdType
- Discord.Types: type IntegrationId = Snowflake
+ Discord.Types: type IntegrationId = DiscordId IntegrationIdType
- Discord.Types: type InteractionId = Snowflake
+ Discord.Types: type InteractionId = DiscordId InteractionIdType
- Discord.Types: type MessageId = Snowflake
+ Discord.Types: type MessageId = DiscordId MessageIdType
- Discord.Types: type OverwriteId = Snowflake
+ Discord.Types: type OverwriteId = DiscordId OverwriteIdType
- Discord.Types: type ParentId = Snowflake
+ Discord.Types: type ParentId = DiscordId ParentIdType
- Discord.Types: type RoleId = Snowflake
+ Discord.Types: type RoleId = DiscordId RoleIdType
- Discord.Types: type ScheduledEventEntityId = Snowflake
+ Discord.Types: type ScheduledEventEntityId = DiscordId ScheduledEventEntityIdType
- Discord.Types: type ScheduledEventId = Snowflake
+ Discord.Types: type ScheduledEventId = DiscordId ScheduledEventIdType
- Discord.Types: type StageId = Snowflake
+ Discord.Types: type StageId = DiscordId StageIdType
- Discord.Types: type StickerId = Snowflake
+ Discord.Types: type StickerId = DiscordId StickerIdType
- Discord.Types: type UserId = Snowflake
+ Discord.Types: type UserId = DiscordId UserIdType
- Discord.Types: type WebhookId = Snowflake
+ Discord.Types: type WebhookId = DiscordId WebhookIdType
Files
- README.md +2/−2
- changelog.md +8/−0
- discord-haskell.cabal +2/−3
- examples/ping-pong.hs +1/−1
- src/Discord.hs +2/−1
- src/Discord/Internal/Rest/ApplicationCommands.hs +1/−1
- src/Discord/Internal/Rest/Channel.hs +1/−1
- src/Discord/Internal/Rest/Interactions.hs +11/−6
- src/Discord/Internal/Rest/Prelude.hs +1/−1
- src/Discord/Internal/Types/ApplicationCommands.hs +171/−170
- src/Discord/Internal/Types/Channel.hs +34/−23
- src/Discord/Internal/Types/Components.hs +90/−90
- src/Discord/Internal/Types/Interactions.hs +118/−116
- src/Discord/Internal/Types/Prelude.hs +80/−22
- src/Discord/Internal/Types/User.hs +1/−1
README.md view
@@ -10,9 +10,9 @@ #### [[installing](./docs/installing.md)] [[debugging](./docs/debugging.md)] [[creating-bot](./docs/creating-bot.md)] -#### [[design](./docs/design.md)] [[contributing](./docs/contributing.md)] [[todo](./docs/todo.md)]- #### [[app-commands](./docs/applicationcommands.md)] [[components](./docs/components.md)] [[cache](./docs/cache.md)] [[embeds](./docs/embeds.md)] [[emoji](./docs/emoji.md)] [[intents](./docs/intents.md)] [[voice](./docs/voice.md)]++#### [[design](./docs/design.md)] [[contributing](./docs/contributing.md)] [[todo](./docs/todo.md)] #### Example
changelog.md view
@@ -6,6 +6,14 @@ ## master +## 1.13.0++[L0neGamer](https://github.com/aquarial/discord-haskell/pull/117) Shorten ApplicationCommand names! To update search [the pull-request](https://github.com/aquarial/discord-haskell/pull/117/files) for what the names are replaced with++[L0neGamer](https://github.com/aquarial/discord-haskell/pull/116) Typesafe Snowflakes (guildid, channelid, userid, etcid)++Improve `restCall` type error messages https://github.com/aquarial/discord-haskell/issues/102+ ## 1.12.5 [Annwan](https://github.com/aquarial/discord-haskell/pull/109) Add `ScheduledEvent` rest API
discord-haskell.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.0 name: discord-haskell -- library version is also noted at src/Discord/Rest/Prelude.hs-version: 1.12.5+version: 1.13.0 description: Functions and data types to write discord bots. Official discord docs <https://discord.com/developers/docs/reference>. .@@ -49,7 +49,7 @@ library ghc-options: -Wall- -fno-warn-type-defaults -fno-warn-unused-record-wildcards+ -fno-warn-type-defaults -fno-warn-unused-record-wildcards -Wunused-packages hs-source-dirs: src default-language: Haskell2010 -- extensions:@@ -104,7 +104,6 @@ , safe-exceptions , text , time- , unordered-containers , websockets , wuss , mtl
examples/ping-pong.hs view
@@ -22,7 +22,7 @@ -- check the url in a discord server -- <server id> <channel id> -- https://discord.com/channels/2385235298674262408/4286572469284672046-testserverid :: Snowflake+testserverid :: GuildId testserverid = -1 -- | Replies "pong" to every message that starts with "ping"
src/Discord.hs view
@@ -16,6 +16,7 @@ , RestCallErrorCode(..) , RunDiscordOpts(..) , FromJSON+ , Request , def ) where @@ -123,7 +124,7 @@ deriving (Show, Read, Eq, Ord) -- | Execute one http request and get a response-restCall :: (FromJSON a, Request (r a)) => r a -> DiscordHandler (Either RestCallErrorCode a)+restCall :: (Request (r a), FromJSON a) => r a -> DiscordHandler (Either RestCallErrorCode a) restCall r = do h <- ask empty <- isEmptyMVar (discordHandleLibraryError h) if not empty
src/Discord/Internal/Rest/ApplicationCommands.hs view
@@ -93,7 +93,7 @@ (GetApplicationCommandPermissions aid gid cid) -> Get (applications aid /: "guilds" // gid /: "commands" // cid /: "permissions") mempty (EditApplicationCommandPermissions aid gid cid ps) ->- Put (applications aid /: "guilds" // gid /: "commands" // cid /: "permissions") (R.ReqBodyJson $ toJSON (GuildApplicationCommandPermissions aid cid gid ps)) mempty+ Put (applications aid /: "guilds" // gid /: "commands" // cid /: "permissions") (R.ReqBodyJson $ toJSON (GuildApplicationCommandPermissions cid aid gid ps)) mempty (BatchEditApplicationCommandPermissions aid gid ps) -> Put (applications aid /: "guilds" // gid /: "commands" /: "permissions") (R.ReqBodyJson $ toJSON ps) mempty where
src/Discord/Internal/Rest/Channel.hs view
@@ -137,7 +137,7 @@ , messageDetailedFile :: Maybe (T.Text, B.ByteString) , messageDetailedAllowedMentions :: Maybe AllowedMentions , messageDetailedReference :: Maybe MessageReference- , messageDetailedComponents :: Maybe [ComponentActionRow]+ , messageDetailedComponents :: Maybe [ActionRow] , messageDetailedStickerIds :: Maybe [StickerId] } deriving (Show, Read, Eq, Ord)
src/Discord/Internal/Rest/Interactions.hs view
@@ -11,7 +11,9 @@ import Discord.Internal.Types import Discord.Internal.Types.Interactions import Network.HTTP.Client.MultipartFormData (PartM, partBS)-import Network.HTTP.Req as R+import Network.HTTP.Req ((/:))+import qualified Network.HTTP.Req as R+import qualified Data.Text as T data InteractionResponseRequest a where CreateInteractionResponse :: InteractionId -> InteractionToken -> InteractionResponse -> InteractionResponseRequest ()@@ -39,12 +41,12 @@ (DeleteFollowupInteractionMessage aid _ _) -> "intrespf " <> show aid interaction :: ApplicationId -> InteractionToken -> R.Url 'R.Https-interaction aid it = baseUrl /: "webhooks" // aid /: it /: "messages"+interaction aid it = baseUrl /: "webhooks" // aid /: fromToken it /: "messages" interactionResponseJsonRequest :: InteractionResponseRequest a -> JsonRequest interactionResponseJsonRequest a = case a of (CreateInteractionResponse iid it i) ->- Post (baseUrl /: "interactions" // iid /: it /: "callback") (convert i) mempty+ Post (baseUrl /: "interactions" // iid /: fromToken it /: "callback") (convert i) mempty (GetOriginalInteractionResponse aid it) -> Get (interaction aid it /: "@original") mempty (EditOriginalInteractionResponse aid it i) ->@@ -52,7 +54,7 @@ (DeleteOriginalInteractionResponse aid it) -> Delete (interaction aid it /: "@original") mempty (CreateFollowupInteractionMessage aid it i) ->- Post (baseUrl /: "webhooks" // aid /: it) (convertIRM i) mempty+ Post (baseUrl /: "webhooks" // aid /: fromToken it) (convertIRM i) mempty (GetFollowupInteractionMessage aid it mid) -> Get (interaction aid it // mid) mempty (EditFollowupInteractionMessage aid it mid i) ->@@ -60,13 +62,16 @@ (DeleteFollowupInteractionMessage aid it mid) -> Delete (interaction aid it // mid) mempty where- convert :: InteractionResponse -> RestIO ReqBodyMultipart+ convert :: InteractionResponse -> RestIO R.ReqBodyMultipart convert ir@(InteractionResponseChannelMessage irm) = R.reqBodyMultipart (partBS "payload_json" (BL.toStrict $ encode ir) : convert' irm) convert ir@(InteractionResponseUpdateMessage irm) = R.reqBodyMultipart (partBS "payload_json" (BL.toStrict $ encode ir) : convert' irm) convert ir = R.reqBodyMultipart [partBS "payload_json" $ BL.toStrict $ encode ir]- convertIRM :: InteractionResponseMessage -> RestIO ReqBodyMultipart+ convertIRM :: InteractionResponseMessage -> RestIO R.ReqBodyMultipart convertIRM irm = R.reqBodyMultipart (partBS "payload_json" (BL.toStrict $ encode irm) : convert' irm) convert' :: InteractionResponseMessage -> [PartM IO] convert' InteractionResponseMessage {..} = case interactionResponseMessageEmbeds of Nothing -> [] Just f -> (maybeEmbed . Just) =<< f++fromToken :: InteractionToken -> T.Text+fromToken (InteractionToken t) = t
src/Discord/Internal/Rest/Prelude.hs view
@@ -34,7 +34,7 @@ where -- | https://discord.com/developers/docs/reference#user-agent -- Second place where the library version is noted- agent = "DiscordBot (https://github.com/aquarial/discord-haskell, 1.12.5)"+ agent = "DiscordBot (https://github.com/aquarial/discord-haskell, 1.13.0)" -- Append to an URL infixl 5 //
src/Discord/Internal/Types/ApplicationCommands.hs view
@@ -10,13 +10,13 @@ module Discord.Internal.Types.ApplicationCommands ( ApplicationCommand (..),- ApplicationCommandOptions (..),- ApplicationCommandOptionSubcommandOrGroup (..),- ApplicationCommandOptionSubcommand (..),- ApplicationCommandOptionValue (..),- createApplicationCommandChatInput,- createApplicationCommandUser,- createApplicationCommandMessage,+ Options (..),+ OptionSubcommandOrGroup (..),+ OptionSubcommand (..),+ OptionValue (..),+ createChatInput,+ createUser,+ createMessage, CreateApplicationCommand (..), EditApplicationCommand (..), defaultEditApplicationCommand,@@ -24,10 +24,11 @@ ApplicationCommandChannelType (..), GuildApplicationCommandPermissions (..), ApplicationCommandPermissions (..),+ Number, ) where -import Data.Aeson+import Data.Aeson (FromJSON (parseJSON), ToJSON (toJSON), Value (Number, Object), object, withArray, withObject, (.!=), (.:), (.:!), (.:?)) import Data.Aeson.Types (Pair, Parser) import Data.Data (Data) import Data.Foldable (Foldable (toList))@@ -35,6 +36,8 @@ import qualified Data.Text as T import Discord.Internal.Types.Prelude (ApplicationCommandId, ApplicationId, GuildId, InternalDiscordEnum (..), Snowflake, discordTypeParseJSON, toMaybeJSON) +type Number = Scientific+ -- | The structure for an application command. data ApplicationCommand = ApplicationCommandUser@@ -77,7 +80,7 @@ -- | The description of the application command. applicationCommandDescription :: T.Text, -- | The parameters for the command.- applicationCommandOptions :: Maybe ApplicationCommandOptions,+ applicationCommandOptions :: Maybe Options, -- | Whether the command is enabled by default when the app is added to a guild. applicationCommandDefaultPermission :: Bool, -- | Autoincrementing version identifier updated during substantial record changes.@@ -107,197 +110,197 @@ ) -- | Either subcommands and groups, or values.-data ApplicationCommandOptions- = ApplicationCommandOptionsSubcommands [ApplicationCommandOptionSubcommandOrGroup]- | ApplicationCommandOptionsValues [ApplicationCommandOptionValue]+data Options+ = OptionsSubcommands [OptionSubcommandOrGroup]+ | OptionsValues [OptionValue] deriving (Show, Eq, Read) -instance FromJSON ApplicationCommandOptions where+instance FromJSON Options where parseJSON = withArray- "ApplicationCommandOptions"+ "Options" ( \a -> do let a' = toList a case a' of- [] -> return $ ApplicationCommandOptionsValues []+ [] -> return $ OptionsValues [] (v' : _) -> withObject- "ApplicationCommandOptions item"+ "Options item" ( \v -> do t <- v .: "type" :: Parser Int if t == 1 || t == 2- then ApplicationCommandOptionsSubcommands <$> mapM parseJSON a'- else ApplicationCommandOptionsValues <$> mapM parseJSON a'+ then OptionsSubcommands <$> mapM parseJSON a'+ else OptionsValues <$> mapM parseJSON a' ) v' ) -instance ToJSON ApplicationCommandOptions where- toJSON (ApplicationCommandOptionsSubcommands o) = toJSON o- toJSON (ApplicationCommandOptionsValues o) = toJSON o+instance ToJSON Options where+ toJSON (OptionsSubcommands o) = toJSON o+ toJSON (OptionsValues o) = toJSON o -- | Either a subcommand group or a subcommand.-data ApplicationCommandOptionSubcommandOrGroup- = ApplicationCommandOptionSubcommandGroup+data OptionSubcommandOrGroup+ = OptionSubcommandGroup { -- | The name of the subcommand group- applicationCommandOptionSubcommandGroupName :: T.Text,+ optionSubcommandGroupName :: T.Text, -- | The description of the subcommand group- applicationCommandOptionSubcommandGroupDescription :: T.Text,+ optionSubcommandGroupDescription :: T.Text, -- | The subcommands in this subcommand group- applicationCommandOptionSubcommandGroupOptions :: [ApplicationCommandOptionSubcommand]+ optionSubcommandGroupOptions :: [OptionSubcommand] }- | ApplicationCommandOptionSubcommandOrGroupSubcommand ApplicationCommandOptionSubcommand+ | OptionSubcommandOrGroupSubcommand OptionSubcommand deriving (Show, Eq, Read) -instance FromJSON ApplicationCommandOptionSubcommandOrGroup where+instance FromJSON OptionSubcommandOrGroup where parseJSON = withObject- "ApplicationCommandOptionSubcommandOrGroup"+ "OptionSubcommandOrGroup" ( \v -> do t <- v .: "type" :: Parser Int case t of 2 ->- ApplicationCommandOptionSubcommandGroup+ OptionSubcommandGroup <$> v .: "name" <*> v .: "description" <*> v .: "options"- 1 -> ApplicationCommandOptionSubcommandOrGroupSubcommand <$> parseJSON (Object v)+ 1 -> OptionSubcommandOrGroupSubcommand <$> parseJSON (Object v) _ -> fail "unexpected subcommand group type" ) -instance ToJSON ApplicationCommandOptionSubcommandOrGroup where- toJSON ApplicationCommandOptionSubcommandGroup {..} =+instance ToJSON OptionSubcommandOrGroup where+ toJSON OptionSubcommandGroup {..} = object [ ("type", Number 2),- ("name", toJSON applicationCommandOptionSubcommandGroupName),- ("description", toJSON applicationCommandOptionSubcommandGroupDescription),- ("options", toJSON applicationCommandOptionSubcommandGroupOptions)+ ("name", toJSON optionSubcommandGroupName),+ ("description", toJSON optionSubcommandGroupDescription),+ ("options", toJSON optionSubcommandGroupOptions) ]- toJSON (ApplicationCommandOptionSubcommandOrGroupSubcommand a) = toJSON a+ toJSON (OptionSubcommandOrGroupSubcommand a) = toJSON a -- | Data for a single subcommand.-data ApplicationCommandOptionSubcommand = ApplicationCommandOptionSubcommand+data OptionSubcommand = OptionSubcommand { -- | The name of the subcommand- applicationCommandOptionSubcommandName :: T.Text,+ optionSubcommandName :: T.Text, -- | The description of the subcommand- applicationCommandOptionSubcommandDescription :: T.Text,+ optionSubcommandDescription :: T.Text, -- | What options are there in this subcommand- applicationCommandOptionSubcommandOptions :: [ApplicationCommandOptionValue]+ optionSubcommandOptions :: [OptionValue] } deriving (Show, Eq, Read) -instance FromJSON ApplicationCommandOptionSubcommand where+instance FromJSON OptionSubcommand where parseJSON = withObject- "ApplicationCommandOptionSubcommand"+ "OptionSubcommand" ( \v -> do t <- v .: "type" :: Parser Int case t of 1 ->- ApplicationCommandOptionSubcommand+ OptionSubcommand <$> v .: "name" <*> v .: "description" <*> v .:? "options" .!= [] _ -> fail "unexpected subcommand type" ) -instance ToJSON ApplicationCommandOptionSubcommand where- toJSON ApplicationCommandOptionSubcommand {..} =+instance ToJSON OptionSubcommand where+ toJSON OptionSubcommand {..} = object [ ("type", Number 1),- ("name", toJSON applicationCommandOptionSubcommandName),- ("description", toJSON applicationCommandOptionSubcommandDescription),- ("options", toJSON applicationCommandOptionSubcommandOptions)+ ("name", toJSON optionSubcommandName),+ ("description", toJSON optionSubcommandDescription),+ ("options", toJSON optionSubcommandOptions) ] -- | Data for a single value.-data ApplicationCommandOptionValue- = ApplicationCommandOptionValueString+data OptionValue+ = OptionValueString { -- | The name of the value- applicationCommandOptionValueName :: T.Text,+ optionValueName :: T.Text, -- | The description of the value- applicationCommandOptionValueDescription :: T.Text,+ optionValueDescription :: T.Text, -- | Whether this option is required- applicationCommandOptionValueRequired :: Bool,+ optionValueRequired :: Bool, -- | Whether to autocomplete or have a list of named choices. For neither option, use `Left False`- applicationCommandOptionValueStringChoices :: AutocompleteOrChoice T.Text+ optionValueStringChoices :: AutocompleteOrChoice T.Text }- | ApplicationCommandOptionValueInteger+ | OptionValueInteger { -- | The name of the value- applicationCommandOptionValueName :: T.Text,+ optionValueName :: T.Text, -- | The description of the value- applicationCommandOptionValueDescription :: T.Text,+ optionValueDescription :: T.Text, -- | Whether this option is required- applicationCommandOptionValueRequired :: Bool,+ optionValueRequired :: Bool, -- | Whether to autocomplete or have a list of named choices. For neither option, use `Left False`- applicationCommandOptionValueIntegerChoices :: AutocompleteOrChoice Integer,+ optionValueIntegerChoices :: AutocompleteOrChoice Integer, -- | The lower bound of values permitted. If choices are provided or autocomplete is on, this can be ignored- applicationCommandOptionValueIntegerMinVal :: Maybe Integer,+ optionValueIntegerMinVal :: Maybe Integer, -- | The upper bound of values permitted. If choices are provided or autocomplete is on, this can be ignored- applicationCommandOptionValueIntegerMaxVal :: Maybe Integer+ optionValueIntegerMaxVal :: Maybe Integer }- | ApplicationCommandOptionValueBoolean+ | OptionValueBoolean { -- | The name of the value- applicationCommandOptionValueName :: T.Text,+ optionValueName :: T.Text, -- | The description of the value- applicationCommandOptionValueDescription :: T.Text,+ optionValueDescription :: T.Text, -- | Whether this option is required- applicationCommandOptionValueRequired :: Bool+ optionValueRequired :: Bool }- | ApplicationCommandOptionValueUser+ | OptionValueUser { -- | The name of the value- applicationCommandOptionValueName :: T.Text,+ optionValueName :: T.Text, -- | The description of the value- applicationCommandOptionValueDescription :: T.Text,+ optionValueDescription :: T.Text, -- | Whether this option is required- applicationCommandOptionValueRequired :: Bool+ optionValueRequired :: Bool }- | ApplicationCommandOptionValueChannel+ | OptionValueChannel { -- | The name of the value- applicationCommandOptionValueName :: T.Text,+ optionValueName :: T.Text, -- | The description of the value- applicationCommandOptionValueDescription :: T.Text,+ optionValueDescription :: T.Text, -- | Whether this option is required- applicationCommandOptionValueRequired :: Bool,+ optionValueRequired :: Bool, -- | What type of channel can be put in here- applicationCommandOptionValueChannelTypes :: Maybe [ApplicationCommandChannelType]+ optionValueChannelTypes :: Maybe [ApplicationCommandChannelType] }- | ApplicationCommandOptionValueRole+ | OptionValueRole { -- | The name of the value- applicationCommandOptionValueName :: T.Text,+ optionValueName :: T.Text, -- | The description of the value- applicationCommandOptionValueDescription :: T.Text,+ optionValueDescription :: T.Text, -- | Whether this option is required- applicationCommandOptionValueRequired :: Bool+ optionValueRequired :: Bool }- | ApplicationCommandOptionValueMentionable+ | OptionValueMentionable { -- | The name of the value- applicationCommandOptionValueName :: T.Text,+ optionValueName :: T.Text, -- | The description of the value- applicationCommandOptionValueDescription :: T.Text,+ optionValueDescription :: T.Text, -- | Whether this option is required- applicationCommandOptionValueRequired :: Bool+ optionValueRequired :: Bool }- | ApplicationCommandOptionValueNumber+ | OptionValueNumber { -- | The name of the value- applicationCommandOptionValueName :: T.Text,+ optionValueName :: T.Text, -- | The description of the value- applicationCommandOptionValueDescription :: T.Text,+ optionValueDescription :: T.Text, -- | Whether this option is required- applicationCommandOptionValueRequired :: Bool,+ optionValueRequired :: Bool, -- | Whether to autocomplete or have a list of named choices. For neither option, use `Left False`- applicationCommandOptionValueNumberChoices :: AutocompleteOrChoice Scientific,+ optionValueNumberChoices :: AutocompleteOrChoice Number, -- | The lower bound of values permitted. If choices are provided or autocomplete is on, this can be ignored- applicationCommandOptionValueNumberMinVal :: Maybe Scientific,+ optionValueNumberMinVal :: Maybe Number, -- | The upper bound of values permitted. If choices are provided or autocomplete is on, this can be ignored- applicationCommandOptionValueNumberMaxVal :: Maybe Scientific+ optionValueNumberMaxVal :: Maybe Number } deriving (Show, Eq, Read) -instance FromJSON ApplicationCommandOptionValue where+instance FromJSON OptionValue where parseJSON = withObject- "ApplicationCommandOptionValue"+ "OptionValue" ( \v -> do name <- v .: "name" desc <- v .: "description"@@ -305,73 +308,73 @@ t <- v .: "type" :: Parser Int case t of 3 ->- ApplicationCommandOptionValueString name desc required+ OptionValueString name desc required <$> parseJSON (Object v) 4 ->- ApplicationCommandOptionValueInteger name desc required+ OptionValueInteger name desc required <$> parseJSON (Object v) <*> v .:? "min_value" <*> v .:? "max_value" 10 ->- ApplicationCommandOptionValueNumber name desc required+ OptionValueNumber name desc required <$> parseJSON (Object v) <*> v .:? "min_value" <*> v .:? "max_value" 7 ->- ApplicationCommandOptionValueChannel name desc required+ OptionValueChannel name desc required <$> v .:? "channel_types"- 5 -> return $ ApplicationCommandOptionValueBoolean name desc required- 6 -> return $ ApplicationCommandOptionValueUser name desc required- 8 -> return $ ApplicationCommandOptionValueRole name desc required- 9 -> return $ ApplicationCommandOptionValueMentionable name desc required+ 5 -> return $ OptionValueBoolean name desc required+ 6 -> return $ OptionValueUser name desc required+ 8 -> return $ OptionValueRole name desc required+ 9 -> return $ OptionValueMentionable name desc required _ -> fail "unknown application command option value type" ) -instance ToJSON ApplicationCommandOptionValue where- toJSON ApplicationCommandOptionValueString {..} =+instance ToJSON OptionValue where+ toJSON OptionValueString {..} = object [ ("type", Number 3),- ("name", toJSON applicationCommandOptionValueName),- ("description", toJSON applicationCommandOptionValueDescription),- ("required", toJSON applicationCommandOptionValueRequired),- choiceOrAutocompleteToJSON applicationCommandOptionValueStringChoices+ ("name", toJSON optionValueName),+ ("description", toJSON optionValueDescription),+ ("required", toJSON optionValueRequired),+ choiceOrAutocompleteToJSON optionValueStringChoices ]- toJSON ApplicationCommandOptionValueInteger {..} =+ toJSON OptionValueInteger {..} = object [ ("type", Number 4),- ("name", toJSON applicationCommandOptionValueName),- ("description", toJSON applicationCommandOptionValueDescription),- ("required", toJSON applicationCommandOptionValueRequired),- choiceOrAutocompleteToJSON applicationCommandOptionValueIntegerChoices+ ("name", toJSON optionValueName),+ ("description", toJSON optionValueDescription),+ ("required", toJSON optionValueRequired),+ choiceOrAutocompleteToJSON optionValueIntegerChoices ]- toJSON ApplicationCommandOptionValueNumber {..} =+ toJSON OptionValueNumber {..} = object [ ("type", Number 10),- ("name", toJSON applicationCommandOptionValueName),- ("description", toJSON applicationCommandOptionValueDescription),- ("required", toJSON applicationCommandOptionValueRequired),- choiceOrAutocompleteToJSON applicationCommandOptionValueNumberChoices+ ("name", toJSON optionValueName),+ ("description", toJSON optionValueDescription),+ ("required", toJSON optionValueRequired),+ choiceOrAutocompleteToJSON optionValueNumberChoices ]- toJSON ApplicationCommandOptionValueChannel {..} =+ toJSON OptionValueChannel {..} = object [ ("type", Number 7),- ("name", toJSON applicationCommandOptionValueName),- ("description", toJSON applicationCommandOptionValueDescription),- ("required", toJSON applicationCommandOptionValueRequired),- ("channel_types", toJSON applicationCommandOptionValueChannelTypes)+ ("name", toJSON optionValueName),+ ("description", toJSON optionValueDescription),+ ("required", toJSON optionValueRequired),+ ("channel_types", toJSON optionValueChannelTypes) ] toJSON acov = object [ ("type", Number (t acov)),- ("name", toJSON $ applicationCommandOptionValueName acov),- ("description", toJSON $ applicationCommandOptionValueDescription acov),- ("required", toJSON $ applicationCommandOptionValueRequired acov)+ ("name", toJSON $ optionValueName acov),+ ("description", toJSON $ optionValueDescription acov),+ ("required", toJSON $ optionValueRequired acov) ] where- t ApplicationCommandOptionValueBoolean {} = 5- t ApplicationCommandOptionValueUser {} = 6- t ApplicationCommandOptionValueRole {} = 8- t ApplicationCommandOptionValueMentionable {} = 9+ t OptionValueBoolean {} = 5+ t OptionValueUser {} = 6+ t OptionValueRole {} = 8+ t OptionValueMentionable {} = 9 t _ = -1 -- | Data type to be used when creating application commands. The specification@@ -393,30 +396,28 @@ data CreateApplicationCommand = CreateApplicationCommandChatInput { -- | The application command name (1-32 chars).- createApplicationCommandName :: T.Text,- -- | The application command description (1-100 chars). Has to be empty for- -- non-slash commands.- createApplicationCommandDescription :: T.Text,- -- | What options the application (max length 25). Has to be `Nothing` for- -- non-slash commands.- createApplicationCommandOptions :: Maybe ApplicationCommandOptions,+ createName :: T.Text,+ -- | The application command description (1-100 chars).+ createDescription :: T.Text,+ -- | What options the application (max length 25).+ createOptions :: Maybe Options, -- | Whether the command is enabled by default when the application is added -- to a guild.- createApplicationCommandDefaultPermission :: Bool+ createDefaultPermission :: Bool } | CreateApplicationCommandUser { -- | The application command name (1-32 chars).- createApplicationCommandName :: T.Text,+ createName :: T.Text, -- | Whether the command is enabled by default when the application is added -- to a guild.- createApplicationCommandDefaultPermission :: Bool+ createDefaultPermission :: Bool } | CreateApplicationCommandMessage { -- | The application command name (1-32 chars).- createApplicationCommandName :: T.Text,+ createName :: T.Text, -- | Whether the command is enabled by default when the application is added -- to a guild.- createApplicationCommandDefaultPermission :: Bool+ createDefaultPermission :: Bool } deriving (Show, Eq, Read) @@ -425,10 +426,10 @@ object [ (name, value) | (name, Just value) <-- [ ("name", toMaybeJSON createApplicationCommandName),- ("description", toMaybeJSON createApplicationCommandDescription),- ("options", toJSON <$> createApplicationCommandOptions),- ("default_permission", toMaybeJSON createApplicationCommandDefaultPermission),+ [ ("name", toMaybeJSON createName),+ ("description", toMaybeJSON createDescription),+ ("options", toJSON <$> createOptions),+ ("default_permission", toMaybeJSON createDefaultPermission), ("type", Just $ Number 1) ] ]@@ -436,8 +437,8 @@ object [ (name, value) | (name, Just value) <-- [ ("name", toMaybeJSON createApplicationCommandName),- ("default_permission", toMaybeJSON createApplicationCommandDefaultPermission),+ [ ("name", toMaybeJSON createName),+ ("default_permission", toMaybeJSON createDefaultPermission), ("type", Just $ Number 2) ] ]@@ -445,8 +446,8 @@ object [ (name, value) | (name, Just value) <-- [ ("name", toMaybeJSON createApplicationCommandName),- ("default_permission", toMaybeJSON createApplicationCommandDefaultPermission),+ [ ("name", toMaybeJSON createName),+ ("default_permission", toMaybeJSON createDefaultPermission), ("type", Just $ Number 3) ] ]@@ -461,22 +462,22 @@ -- 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.-createApplicationCommandChatInput :: T.Text -> T.Text -> Maybe CreateApplicationCommand-createApplicationCommandChatInput name desc+createChatInput :: T.Text -> T.Text -> Maybe CreateApplicationCommand+createChatInput name desc | nameIsValid True name && not (T.null desc) && T.length desc <= 100 = Just $ CreateApplicationCommandChatInput name desc Nothing True | otherwise = Nothing -- | 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.-createApplicationCommandUser :: T.Text -> Maybe CreateApplicationCommand-createApplicationCommandUser name+createUser :: T.Text -> Maybe CreateApplicationCommand+createUser name | nameIsValid False name = Just $ CreateApplicationCommandUser name True | otherwise = Nothing -- | 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.-createApplicationCommandMessage :: T.Text -> Maybe CreateApplicationCommand-createApplicationCommandMessage name+createMessage :: T.Text -> Maybe CreateApplicationCommand+createMessage name | nameIsValid False name = Just $ CreateApplicationCommandMessage name True | otherwise = Nothing @@ -487,18 +488,18 @@ -- https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command data EditApplicationCommand = EditApplicationCommandChatInput- { editApplicationCommandName :: Maybe T.Text,- editApplicationCommandDescription :: Maybe T.Text,- editApplicationCommandOptions :: Maybe ApplicationCommandOptions,- editApplicationCommandDefaultPermission :: Maybe Bool+ { editName :: Maybe T.Text,+ editDescription :: Maybe T.Text,+ editOptions :: Maybe Options,+ editDefaultPermission :: Maybe Bool } | EditApplicationCommandUser- { editApplicationCommandName :: Maybe T.Text,- editApplicationCommandDefaultPermission :: Maybe Bool+ { editName :: Maybe T.Text,+ editDefaultPermission :: Maybe Bool } | EditApplicationCommandMessage- { editApplicationCommandName :: Maybe T.Text,- editApplicationCommandDefaultPermission :: Maybe Bool+ { editName :: Maybe T.Text,+ editDefaultPermission :: Maybe Bool } defaultEditApplicationCommand :: Int -> EditApplicationCommand@@ -511,10 +512,10 @@ object [ (name, value) | (name, Just value) <-- [ ("name", toJSON <$> editApplicationCommandName),- ("description", toJSON <$> editApplicationCommandDescription),- ("options", toJSON <$> editApplicationCommandOptions),- ("default_permission", toJSON <$> editApplicationCommandDefaultPermission),+ [ ("name", toJSON <$> editName),+ ("description", toJSON <$> editDescription),+ ("options", toJSON <$> editOptions),+ ("default_permission", toJSON <$> editDefaultPermission), ("type", Just $ Number 1) ] ]@@ -522,8 +523,8 @@ object [ (name, value) | (name, Just value) <-- [ ("name", toJSON <$> editApplicationCommandName),- ("default_permission", toJSON <$> editApplicationCommandDefaultPermission),+ [ ("name", toJSON <$> editName),+ ("default_permission", toJSON <$> editDefaultPermission), ("type", Just $ Number 2) ] ]@@ -531,8 +532,8 @@ object [ (name, value) | (name, Just value) <-- [ ("name", toJSON <$> editApplicationCommandName),- ("default_permission", toJSON <$> editApplicationCommandDefaultPermission),+ [ ("name", toJSON <$> editName),+ ("default_permission", toJSON <$> editDefaultPermission), ("type", Just $ Number 3) ] ]
src/Discord/Internal/Types/Channel.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TypeApplications #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE DeriveDataTypeable #-} @@ -19,7 +18,7 @@ import Discord.Internal.Types.Prelude import Discord.Internal.Types.User (User(..), GuildMember) import Discord.Internal.Types.Embed-import Discord.Internal.Types.Components (ComponentActionRow)+import Discord.Internal.Types.Components (ActionRow) import Discord.Internal.Types.Emoji -- | Guild channels represent an isolated set of users and messages in a Guild (Server)@@ -223,7 +222,8 @@ instance ToJSON Channel where toJSON ChannelText{..} = object [(name,value) | (name, Just value) <-- [ ("id", toJSON <$> pure channelId)+ [ ("type", Just (Number 0))+ , ("id", toJSON <$> pure channelId) , ("guild_id", toJSON <$> pure channelGuild) , ("name", toJSON <$> pure channelName) , ("position", toJSON <$> pure channelPosition)@@ -235,7 +235,8 @@ , ("parent_id", toJSON <$> pure channelParentId) ] ] toJSON ChannelNews{..} = object [(name,value) | (name, Just value) <-- [ ("id", toJSON <$> pure channelId)+ [ ("type", Just (Number 5))+ , ("id", toJSON <$> pure channelId) , ("guild_id", toJSON <$> pure channelGuild) , ("name", toJSON <$> pure channelName) , ("position", toJSON <$> pure channelPosition)@@ -243,9 +244,11 @@ , ("nsfw", toJSON <$> pure channelNSFW) , ("topic", toJSON <$> pure channelTopic) , ("last_message_id", toJSON <$> channelLastMessage)+ ] ] toJSON ChannelStorePage{..} = object [(name,value) | (name, Just value) <-- [ ("id", toJSON <$> pure channelId)+ [ ("type", Just (Number 6))+ , ("id", toJSON <$> pure channelId) , ("guild_id", toJSON <$> pure channelGuild) , ("name", toJSON <$> pure channelName) , ("nsfw", toJSON <$> pure channelNSFW)@@ -253,12 +256,14 @@ , ("permission_overwrites", toJSON <$> pure channelPermissions) ] ] toJSON ChannelDirectMessage{..} = object [(name,value) | (name, Just value) <-- [ ("id", toJSON <$> pure channelId)+ [ ("type", Just (Number 1))+ , ("id", toJSON <$> pure channelId) , ("recipients", toJSON <$> pure channelRecipients) , ("last_message_id", toJSON <$> channelLastMessage) ] ] toJSON ChannelVoice{..} = object [(name,value) | (name, Just value) <-- [ ("id", toJSON <$> pure channelId)+ [ ("type", Just (Number 2))+ , ("id", toJSON <$> pure channelId) , ("guild_id", toJSON <$> pure channelGuild) , ("name", toJSON <$> pure channelName) , ("position", toJSON <$> pure channelPosition)@@ -268,23 +273,27 @@ , ("user_limit", toJSON <$> pure channelUserLimit) ] ] toJSON ChannelGroupDM{..} = object [(name,value) | (name, Just value) <-- [ ("id", toJSON <$> pure channelId)+ [ ("type", Just (Number 3))+ , ("id", toJSON <$> pure channelId) , ("recipients", toJSON <$> pure channelRecipients) , ("last_message_id", toJSON <$> channelLastMessage) ] ] toJSON ChannelGuildCategory{..} = object [(name,value) | (name, Just value) <-- [ ("id", toJSON <$> pure channelId)+ [ ("type", Just (Number 4))+ , ("id", toJSON <$> pure channelId) , ("name", toJSON <$> pure channelName) , ("guild_id", toJSON <$> pure channelGuild) ] ] toJSON ChannelStage{..} = object [(name,value) | (name, Just value) <-- [ ("id", toJSON <$> pure channelId)+ [ ("type", Just (Number 13))+ , ("id", toJSON <$> pure channelId) , ("guild_id", toJSON <$> pure channelGuild) , ("channel_id", toJSON <$> pure channelStageId) , ("topic", toJSON <$> pure channelStageTopic) ] ] toJSON ChannelNewsThread{..} = object [(name,value) | (name, Just value) <-- [ ("id", toJSON <$> pure channelId)+ [ ("type", Just (Number 10))+ , ("id", toJSON <$> pure channelId) , ("guild_id", toJSON <$> pure channelGuild) , ("name", toJSON <$> channelThreadName) , ("rate_limit_per_user", toJSON <$> channelUserRateLimitThread)@@ -294,7 +303,8 @@ , ("member", toJSON <$> channelThreadMember) ] ] toJSON ChannelPublicThread{..} = object [(name,value) | (name, Just value) <-- [ ("id", toJSON <$> pure channelId)+ [ ("type", Just (Number 11))+ , ("id", toJSON <$> pure channelId) , ("guild_id", toJSON <$> pure channelGuild) , ("name", toJSON <$> channelThreadName) , ("rate_limit_per_user", toJSON <$> channelUserRateLimitThread)@@ -304,7 +314,8 @@ , ("member", toJSON <$> channelThreadMember) ] ] toJSON ChannelPrivateThread{..} = object [(name,value) | (name, Just value) <-- [ ("id", toJSON <$> pure channelId)+ [ ("type", Just (Number 12))+ , ("id", toJSON <$> pure channelId) , ("guild_id", toJSON <$> pure channelGuild) , ("name", toJSON <$> channelThreadName) , ("rate_limit_per_user", toJSON <$> channelUserRateLimitThread)@@ -405,7 +416,7 @@ , ("flags", toJSON <$> pure threadMemberFlags) ] ] -data ThreadListSyncFields = ThreadListSyncFields +data ThreadListSyncFields = ThreadListSyncFields { threadListSyncFieldsGuildId :: GuildId , threadListSyncFieldsChannelIds :: Maybe [ChannelId] , threadListSyncFieldsThreads :: [Channel]@@ -419,7 +430,7 @@ <*> o .: "threads" <*> o .: "members" -data ThreadMembersUpdateFields = ThreadMembersUpdateFields +data ThreadMembersUpdateFields = ThreadMembersUpdateFields { threadMembersUpdateFieldsThreadId :: ChannelId , threadMembersUpdateFieldsGuildId :: GuildId , threadMembersUpdateFieldsMemberCount :: Integer@@ -470,7 +481,7 @@ , messageReferencedMessage :: Maybe Message -- ^ The full original message , messageInteraction :: Maybe MessageInteraction -- ^ sent if message is an interaction response , messageThread :: Maybe Channel -- ^ the thread that was started from this message, includes thread member object- , messageComponents :: Maybe [ComponentActionRow] -- ^ sent if the message contains components like buttons, action rows, or other interactive components+ , messageComponents :: Maybe [ActionRow] -- ^ sent if the message contains components like buttons, action rows, or other interactive components , messageStickerItems :: Maybe [StickerItem] -- ^ sent if the message contains stickers } deriving (Show, Read, Eq, Ord) @@ -565,15 +576,15 @@ instance ToJSON AllowedMentions where toJSON AllowedMentions{..} = object [- ("parse" .= [name :: T.Text | (name, True) <-- [ ("everyone", mentionEveryone),- ("users", mentionUsers && mentionUserIds == []),- ("roles", mentionRoles && mentionRoleIds == []) ] ]),+ "parse" .= [name :: T.Text | (name, True) <-+ [ ("everyone", mentionEveryone),+ ("users", mentionUsers && null mentionUserIds),+ ("roles", mentionRoles && null mentionRoleIds) ] ], -- https://discord.com/developers/docs/resources/channel#allowed-mentions-object -- parse.users and users list cannot both be active, prioritize id list- ("roles" .= mentionRoleIds),- ("users" .= mentionUserIds),- ("replied_user" .= mentionRepliedUser) ]+ "roles" .= mentionRoleIds,+ "users" .= mentionUserIds,+ "replied_user" .= mentionRepliedUser ] data MessageReaction = MessageReaction { messageReactionCount :: Int
src/Discord/Internal/Types/Components.hs view
@@ -7,16 +7,16 @@ {-# LANGUAGE RecordWildCards #-} module Discord.Internal.Types.Components- ( ComponentActionRow (..),- ComponentButton (..),+ ( ActionRow (..),+ Button (..), ButtonStyle (..), mkButton,- ComponentSelectMenu (..),+ SelectMenu (..), mkSelectMenu, SelectOption (..), mkSelectOption,- ComponentTextInput (..),- mkComponentTextInput,+ TextInput (..),+ mkTextInput, ) where @@ -28,13 +28,13 @@ import Discord.Internal.Types.Emoji (Emoji) import Discord.Internal.Types.Prelude (toMaybeJSON) -data ComponentActionRow = ComponentActionRowButton [ComponentButton] | ComponentActionRowSelectMenu ComponentSelectMenu+data ActionRow = ActionRowButtons [Button] | ActionRowSelectMenu SelectMenu deriving (Show, Read, Eq, Ord) -instance FromJSON ComponentActionRow where+instance FromJSON ActionRow where parseJSON = withObject- "ComponentActionRow"+ "ActionRow" ( \cs -> do t <- cs .: "type" :: Parser Int case t of@@ -42,62 +42,62 @@ a <- cs .: "components" :: Parser Array let a' = toList a case a' of- [] -> return $ ComponentActionRowButton []+ [] -> return $ ActionRowButtons [] (c : _) -> withObject- "ComponentActionRow item"+ "ActionRow item" ( \v -> do t' <- v .: "type" :: Parser Int case t' of- 2 -> ComponentActionRowButton <$> mapM parseJSON a'- 3 -> ComponentActionRowSelectMenu <$> parseJSON c+ 2 -> ActionRowButtons <$> mapM parseJSON a'+ 3 -> ActionRowSelectMenu <$> parseJSON c _ -> fail $ "unknown component type: " ++ show t ) c _ -> fail $ "expected action row type (1), got: " ++ show t ) -instance ToJSON ComponentActionRow where- toJSON (ComponentActionRowButton bs) = object [("type", Number 1), ("components", toJSON bs)]- toJSON (ComponentActionRowSelectMenu bs) = object [("type", Number 1), ("components", toJSON [bs])]+instance ToJSON ActionRow where+ toJSON (ActionRowButtons bs) = object [("type", Number 1), ("components", toJSON bs)]+ toJSON (ActionRowSelectMenu bs) = object [("type", Number 1), ("components", toJSON [bs])] -- | Component type for a button, split into URL button and not URL button. -- -- Don't directly send button components - they need to be within an action row.-data ComponentButton- = ComponentButton+data Button+ = Button { -- | Dev indentifier- componentButtonCustomId :: T.Text,+ buttonCustomId :: T.Text, -- | Whether the button is disabled- componentButtonDisabled :: Bool,+ buttonDisabled :: Bool, -- | What is the style of the button- componentButtonStyle :: ButtonStyle,+ buttonStyle :: ButtonStyle, -- | What is the user-facing label of the button- componentButtonLabel :: Maybe T.Text,+ buttonLabel :: Maybe T.Text, -- | What emoji is displayed on the button- componentButtonEmoji :: Maybe Emoji+ buttonEmoji :: Maybe Emoji }- | ComponentButtonUrl+ | ButtonUrl { -- | The url for the button. If this is not a valid url, everything will -- break- componentButtonUrl :: T.Text,+ buttonUrl :: T.Text, -- | Whether the button is disabled- componentButtonDisabled :: Bool,+ buttonDisabled :: Bool, -- | What is the user-facing label of the button- componentButtonLabel :: Maybe T.Text,+ buttonLabel :: Maybe T.Text, -- | What emoji is displayed on the button- componentButtonEmoji :: Maybe Emoji+ buttonEmoji :: Maybe Emoji } deriving (Show, Read, Eq, Ord) -- | Takes the label and the custom id of the button that is to be generated.-mkButton :: T.Text -> T.Text -> ComponentButton-mkButton label customId = ComponentButton customId False ButtonStyleSecondary (Just label) Nothing+mkButton :: T.Text -> T.Text -> Button+mkButton label customId = Button customId False ButtonStyleSecondary (Just label) Nothing -instance FromJSON ComponentButton where+instance FromJSON Button where parseJSON = withObject- "ComponentButton"+ "Button" ( \v -> do t <- v .: "type" :: Parser Int case t of@@ -108,13 +108,13 @@ style <- v .: "style" :: Parser Scientific case style of 5 ->- ComponentButtonUrl+ ButtonUrl <$> v .: "url" <*> return disabled <*> return label <*> return partialEmoji _ ->- ComponentButton+ Button <$> v .: "custom_id" <*> return disabled <*> parseJSON (Number style)@@ -123,29 +123,29 @@ _ -> fail "expected button type, got a different component" ) -instance ToJSON ComponentButton where- toJSON ComponentButtonUrl {..} =+instance ToJSON Button where+ toJSON ButtonUrl {..} = object [ (name, value) | (name, Just value) <- [ ("type", Just $ Number 2), ("style", Just $ Number 5),- ("label", toJSON <$> componentButtonLabel),- ("disabled", toMaybeJSON componentButtonDisabled),- ("url", toMaybeJSON componentButtonUrl),- ("emoji", toJSON <$> componentButtonEmoji)+ ("label", toJSON <$> buttonLabel),+ ("disabled", toMaybeJSON buttonDisabled),+ ("url", toMaybeJSON buttonUrl),+ ("emoji", toJSON <$> buttonEmoji) ] ]- toJSON ComponentButton {..} =+ toJSON Button {..} = object [ (name, value) | (name, Just value) <- [ ("type", Just $ Number 2),- ("style", Just $ toJSON componentButtonStyle),- ("label", toJSON <$> componentButtonLabel),- ("disabled", toMaybeJSON componentButtonDisabled),- ("custom_id", toMaybeJSON componentButtonCustomId),- ("emoji", toJSON <$> componentButtonEmoji)+ ("style", Just $ toJSON buttonStyle),+ ("label", toJSON <$> buttonLabel),+ ("disabled", toMaybeJSON buttonDisabled),+ ("custom_id", toMaybeJSON buttonCustomId),+ ("emoji", toJSON <$> buttonEmoji) ] ] @@ -179,40 +179,40 @@ toJSON ButtonStyleSuccess = Number 3 toJSON ButtonStyleDanger = Number 4 --- | Component type for a select menus.+-- | Component type for a select menu. -- -- Don't directly send select menus - they need to be within an action row.-data ComponentSelectMenu = ComponentSelectMenu+data SelectMenu = SelectMenu { -- | Dev identifier- componentSelectMenuCustomId :: T.Text,+ selectMenuCustomId :: T.Text, -- | Whether the select menu is disabled- componentSelectMenuDisabled :: Bool,+ selectMenuDisabled :: Bool, -- | What options are in this select menu (up to 25)- componentSelectMenuOptions :: [SelectOption],+ selectMenuOptions :: [SelectOption], -- | Placeholder text if nothing is selected- componentSelectMenuPlaceholder :: Maybe T.Text,+ selectMenuPlaceholder :: Maybe T.Text, -- | Minimum number of values to select (def 1, min 0, max 25)- componentSelectMenuMinValues :: Maybe Integer,+ selectMenuMinValues :: Maybe Integer, -- | Maximum number of values to select (def 1, max 25)- componentSelectMenuMaxValues :: Maybe Integer+ selectMenuMaxValues :: Maybe Integer } deriving (Show, Read, Eq, Ord) -- | Takes the custom id and the options of the select menu that is to be -- generated.-mkSelectMenu :: T.Text -> [SelectOption] -> ComponentSelectMenu-mkSelectMenu customId sos = ComponentSelectMenu customId False sos Nothing Nothing Nothing+mkSelectMenu :: T.Text -> [SelectOption] -> SelectMenu+mkSelectMenu customId sos = SelectMenu customId False sos Nothing Nothing Nothing -instance FromJSON ComponentSelectMenu where+instance FromJSON SelectMenu where parseJSON = withObject- "ComponentSelectMenu"+ "SelectMenu" ( \v -> do t <- v .: "type" :: Parser Int case t of 3 ->- ComponentSelectMenu+ SelectMenu <$> v .: "custom_id" <*> v .:? "disabled" .!= False <*> v .: "options"@@ -222,18 +222,18 @@ _ -> fail "expected select menu type, got different component" ) -instance ToJSON ComponentSelectMenu where- toJSON ComponentSelectMenu {..} =+instance ToJSON SelectMenu where+ toJSON SelectMenu {..} = object [ (name, value) | (name, Just value) <- [ ("type", Just $ Number 3),- ("custom_id", toMaybeJSON componentSelectMenuCustomId),- ("disabled", toMaybeJSON componentSelectMenuDisabled),- ("options", toMaybeJSON componentSelectMenuOptions),- ("placeholder", toJSON <$> componentSelectMenuPlaceholder),- ("min_values", toJSON <$> componentSelectMenuMinValues),- ("max_values", toJSON <$> componentSelectMenuMaxValues)+ ("custom_id", toMaybeJSON selectMenuCustomId),+ ("disabled", toMaybeJSON selectMenuDisabled),+ ("options", toMaybeJSON selectMenuOptions),+ ("placeholder", toJSON <$> selectMenuPlaceholder),+ ("min_values", toJSON <$> selectMenuMinValues),+ ("max_values", toJSON <$> selectMenuMaxValues) ] ] @@ -277,49 +277,49 @@ ] ] -data ComponentTextInput = ComponentTextInput+data TextInput = TextInput { -- | Dev identifier- componentTextInputCustomId :: T.Text,+ textInputCustomId :: T.Text, -- | What style to use (short or paragraph)- componentTextInputIsParagraph :: Bool,+ textInputIsParagraph :: Bool, -- | The label for this component- componentTextInputLabel :: T.Text,+ textInputLabel :: T.Text, -- | The minimum input length for a text input (0-4000)- componentTextInputMinLength :: Maybe Integer,+ textInputMinLength :: Maybe Integer, -- | The maximum input length for a text input (1-4000)- componentTextInputMaxLength :: Maybe Integer,+ textInputMaxLength :: Maybe Integer, -- | Whether this component is required to be filled- componentTextInputRequired :: Bool,+ textInputRequired :: Bool, -- | The prefilled value for this component (max 4000)- componentTextInputValue :: T.Text,+ textInputValue :: T.Text, -- | Placeholder text if empty (max 4000)- componentTextInputPlaceholder :: T.Text+ textInputPlaceholder :: T.Text } deriving (Show, Read, Eq, Ord) -instance ToJSON ComponentTextInput where- toJSON ComponentTextInput {..} =+instance ToJSON TextInput where+ toJSON TextInput {..} = object [ (name, value) | (name, Just value) <- [ ("type", Just $ Number 4),- ("custom_id", toMaybeJSON componentTextInputCustomId),- ("style", toMaybeJSON (1 + fromEnum componentTextInputIsParagraph)),- ("label", toMaybeJSON componentTextInputLabel),- ("min_length", toJSON <$> componentTextInputMinLength),- ("max_length", toJSON <$> componentTextInputMaxLength),- ("required", toMaybeJSON componentTextInputRequired),- ("value", toMaybeJSON componentTextInputValue),- ("placeholder", toMaybeJSON componentTextInputPlaceholder)+ ("custom_id", toMaybeJSON textInputCustomId),+ ("style", toMaybeJSON (1 + fromEnum textInputIsParagraph)),+ ("label", toMaybeJSON textInputLabel),+ ("min_length", toJSON <$> textInputMinLength),+ ("max_length", toJSON <$> textInputMaxLength),+ ("required", toMaybeJSON textInputRequired),+ ("value", toMaybeJSON textInputValue),+ ("placeholder", toMaybeJSON textInputPlaceholder) ] ] -instance FromJSON ComponentTextInput where- parseJSON = withObject "ComponentTextInput" $ \o -> do+instance FromJSON TextInput where+ parseJSON = withObject "TextInput" $ \o -> do t <- o .: "type" :: Parser Int case t of 4 ->- ComponentTextInput <$> o .: "custom_id"+ TextInput <$> o .: "custom_id" <*> fmap (== (2 :: Int)) (o .:? "style" .!= 1) <*> o .:? "label" .!= "" <*> o .:? "min_length"@@ -329,5 +329,5 @@ <*> o .:? "placeholder" .!= "" _ -> fail "expected text input, found other type of component" -mkComponentTextInput :: T.Text -> T.Text -> ComponentTextInput-mkComponentTextInput cid label = ComponentTextInput cid False label Nothing Nothing True "" ""+mkTextInput :: T.Text -> T.Text -> TextInput+mkTextInput cid label = TextInput cid False label Nothing Nothing True "" ""
src/Discord/Internal/Types/Interactions.hs view
@@ -9,12 +9,12 @@ module Discord.Internal.Types.Interactions ( Interaction (..),- InteractionDataComponent (..),- InteractionDataApplicationCommand (..),- InteractionDataApplicationCommandOptions (..),- InteractionDataApplicationCommandOptionSubcommandOrGroup (..),- InteractionDataApplicationCommandOptionSubcommand (..),- InteractionDataApplicationCommandOptionValue (..),+ ComponentData (..),+ ApplicationCommandData (..),+ OptionsData (..),+ OptionDataSubcommandOrGroup (..),+ OptionDataSubcommand (..),+ OptionDataValue (..), InteractionToken, ResolvedData (..), MemberOrUser (..),@@ -35,11 +35,10 @@ import Data.Aeson.Types (Parser) import Data.Bits (Bits (shift, (.|.))) import Data.Foldable (Foldable (toList))-import Data.Scientific (Scientific) import qualified Data.Text as T-import Discord.Internal.Types.ApplicationCommands (Choice)+import Discord.Internal.Types.ApplicationCommands (Choice, Number) import Discord.Internal.Types.Channel (AllowedMentions, Attachment, Message)-import Discord.Internal.Types.Components (ComponentActionRow, ComponentTextInput)+import Discord.Internal.Types.Components (ActionRow, TextInput) import Discord.Internal.Types.Embed (CreateEmbed, createEmbed) import Discord.Internal.Types.Prelude (ApplicationCommandId, ApplicationId, ChannelId, GuildId, InteractionId, InteractionToken, MessageId, RoleId, Snowflake, UserId) import Discord.Internal.Types.User (GuildMember, User)@@ -52,7 +51,7 @@ -- | The id of the application that this interaction belongs to. interactionApplicationId :: ApplicationId, -- | The data for this interaction.- interactionDataComponent :: InteractionDataComponent,+ componentData :: ComponentData, -- | What guild this interaction comes from. interactionGuildId :: Maybe GuildId, -- | What channel this interaction comes from.@@ -86,7 +85,7 @@ -- | The id of the application that this interaction belongs to. interactionApplicationId :: ApplicationId, -- | The data for this interaction.- interactionDataApplicationCommand :: InteractionDataApplicationCommand,+ applicationCommandData :: ApplicationCommandData, -- | What guild this interaction comes from. interactionGuildId :: Maybe GuildId, -- | What channel this interaction comes from.@@ -108,7 +107,7 @@ -- | The id of the application that this interaction belongs to. interactionApplicationId :: ApplicationId, -- | The data for this interaction.- interactionDataApplicationCommand :: InteractionDataApplicationCommand,+ applicationCommandData :: ApplicationCommandData, -- | What guild this interaction comes from. interactionGuildId :: Maybe GuildId, -- | What channel this interaction comes from.@@ -130,7 +129,7 @@ -- | The id of the application that this interaction belongs to. interactionApplicationId :: ApplicationId, -- | The data for this interaction.- interactionDataModal :: InteractionDataModal,+ modalData :: ModalData, -- | What guild this interaction comes from. interactionGuildId :: Maybe GuildId, -- | What channel this interaction comes from.@@ -217,71 +216,71 @@ ( \v -> MemberOrUser <$> ((Left <$> v .: "member") <|> (Right <$> v .: "user")) ) -data InteractionDataComponent- = InteractionDataComponentButton+data ComponentData+ = ButtonData { -- | The unique id of the component (up to 100 characters).- interactionDataComponentCustomId :: T.Text+ componentDataCustomId :: T.Text }- | InteractionDataComponentSelectMenu+ | SelectMenuData { -- | The unique id of the component (up to 100 characters).- interactionDataComponentCustomId :: T.Text,+ componentDataCustomId :: T.Text, -- | Values for the select menu.- interactionDataComponentValues :: [T.Text]+ componentDataValues :: [T.Text] } deriving (Show, Read, Eq, Ord) -instance FromJSON InteractionDataComponent where+instance FromJSON ComponentData where parseJSON = withObject- "InteractionDataComponent"+ "ComponentData" ( \v -> do cid <- v .: "custom_id" t <- v .: "component_type" :: Parser Int case t of- 2 -> return $ InteractionDataComponentButton cid+ 2 -> return $ ButtonData cid 3 ->- InteractionDataComponentSelectMenu cid+ SelectMenuData cid <$> v .: "values" _ -> fail "unknown interaction data component type" ) -data InteractionDataApplicationCommand- = InteractionDataApplicationCommandUser+data ApplicationCommandData+ = ApplicationCommandDataUser { -- | Id of the invoked command.- interactionDataApplicationCommandId :: ApplicationCommandId,+ applicationCommandDataId :: ApplicationCommandId, -- | Name of the invoked command.- interactionDataApplicationCommandName :: T.Text,+ applicationCommandDataName :: T.Text, -- | The resolved data in the command.- interactionDataApplicationCommandResolvedData :: Maybe ResolvedData,+ resolvedData :: Maybe ResolvedData, -- | The id of the user that is the target.- interactionDataApplicationCommandTargetId :: UserId+ applicationCommandDataTargetUserId :: UserId }- | InteractionDataApplicationCommandMessage+ | ApplicationCommandDataMessage { -- | Id of the invoked command.- interactionDataApplicationCommandId :: ApplicationCommandId,+ applicationCommandDataId :: ApplicationCommandId, -- | Name of the invoked command.- interactionDataApplicationCommandName :: T.Text,+ applicationCommandDataName :: T.Text, -- | The resolved data in the command.- interactionDataApplicationCommandResolvedData :: Maybe ResolvedData,+ resolvedData :: Maybe ResolvedData, -- | The id of the message that is the target.- interactionDataApplicationCommandTargetId :: MessageId+ applicationCommandDataTargetMessageId :: MessageId }- | InteractionDataApplicationCommandChatInput+ | ApplicationCommandDataChatInput { -- | Id of the invoked command.- interactionDataApplicationCommandId :: ApplicationCommandId,+ applicationCommandDataId :: ApplicationCommandId, -- | Name of the invoked command.- interactionDataApplicationCommandName :: T.Text,+ applicationCommandDataName :: T.Text, -- | The resolved data in the command.- interactionDataApplicationCommandResolvedData :: Maybe ResolvedData,+ resolvedData :: Maybe ResolvedData, -- | The options of the application command.- interactionDataApplicationCommandOptions :: Maybe InteractionDataApplicationCommandOptions+ optionsData :: Maybe OptionsData } deriving (Show, Read, Eq, Ord) -instance FromJSON InteractionDataApplicationCommand where+instance FromJSON ApplicationCommandData where parseJSON = withObject- "InteractionDataApplicationCommand"+ "ApplicationCommandData" ( \v -> do aci <- v .: "id" name <- v .: "name"@@ -289,86 +288,86 @@ t <- v .: "type" :: Parser Int case t of 1 ->- InteractionDataApplicationCommandChatInput aci name rd+ ApplicationCommandDataChatInput aci name rd <$> v .:? "options" 2 ->- InteractionDataApplicationCommandUser aci name rd+ ApplicationCommandDataUser aci name rd <$> v .: "target_id" 3 ->- InteractionDataApplicationCommandMessage aci name rd+ ApplicationCommandDataMessage aci name rd <$> v .: "target_id" _ -> fail "unknown interaction data component type" ) -- | Either subcommands and groups, or values.-data InteractionDataApplicationCommandOptions- = InteractionDataApplicationCommandOptionsSubcommands [InteractionDataApplicationCommandOptionSubcommandOrGroup]- | InteractionDataApplicationCommandOptionsValues [InteractionDataApplicationCommandOptionValue]+data OptionsData+ = OptionsDataSubcommands [OptionDataSubcommandOrGroup]+ | OptionsDataValues [OptionDataValue] deriving (Show, Read, Eq, Ord) -instance FromJSON InteractionDataApplicationCommandOptions where+instance FromJSON OptionsData where parseJSON = withArray- "InteractionDataApplicationCommandOptions"+ "OptionsData" ( \a -> do let a' = toList a case a' of- [] -> return $ InteractionDataApplicationCommandOptionsValues []+ [] -> return $ OptionsDataValues [] (v' : _) -> withObject- "InteractionDataApplicationCommandOptions item"+ "OptionsData item" ( \v -> do t <- v .: "type" :: Parser Int if t == 1 || t == 2- then InteractionDataApplicationCommandOptionsSubcommands <$> mapM parseJSON a'- else InteractionDataApplicationCommandOptionsValues <$> mapM parseJSON a'+ then OptionsDataSubcommands <$> mapM parseJSON a'+ else OptionsDataValues <$> mapM parseJSON a' ) v' ) -- | Either a subcommand group or a subcommand.-data InteractionDataApplicationCommandOptionSubcommandOrGroup- = InteractionDataApplicationCommandOptionSubcommandGroup- { interactionDataApplicationCommandOptionSubcommandGroupName :: T.Text,- interactionDataApplicationCommandOptionSubcommandGroupOptions :: [InteractionDataApplicationCommandOptionSubcommand],- interactionDataApplicationCommandOptionSubcommandGroupFocused :: Bool+data OptionDataSubcommandOrGroup+ = OptionDataSubcommandGroup+ { optionDataSubcommandGroupName :: T.Text,+ optionDataSubcommandGroupOptions :: [OptionDataSubcommand],+ optionDataSubcommandGroupFocused :: Bool }- | InteractionDataApplicationCommandOptionSubcommandOrGroupSubcommand InteractionDataApplicationCommandOptionSubcommand+ | OptionDataSubcommandOrGroupSubcommand OptionDataSubcommand deriving (Show, Read, Eq, Ord) -instance FromJSON InteractionDataApplicationCommandOptionSubcommandOrGroup where+instance FromJSON OptionDataSubcommandOrGroup where parseJSON = withObject- "InteractionDataApplicationCommandOptionSubcommandOrGroup"+ "OptionDataSubcommandOrGroup" ( \v -> do t <- v .: "type" :: Parser Int case t of 2 ->- InteractionDataApplicationCommandOptionSubcommandGroup+ OptionDataSubcommandGroup <$> v .: "name" <*> v .: "options" <*> v .:? "focused" .!= False- 1 -> InteractionDataApplicationCommandOptionSubcommandOrGroupSubcommand <$> parseJSON (Object v)+ 1 -> OptionDataSubcommandOrGroupSubcommand <$> parseJSON (Object v) _ -> fail "unexpected subcommand group type" ) -- | Data for a single subcommand.-data InteractionDataApplicationCommandOptionSubcommand = InteractionDataApplicationCommandOptionSubcommand- { interactionDataApplicationCommandOptionSubcommandName :: T.Text,- interactionDataApplicationCommandOptionSubcommandOptions :: [InteractionDataApplicationCommandOptionValue],- interactionDataApplicationCommandOptionSubcommandFocused :: Bool+data OptionDataSubcommand = OptionDataSubcommand+ { optionDataSubcommandName :: T.Text,+ optionDataSubcommandOptions :: [OptionDataValue],+ optionDataSubcommandFocused :: Bool } deriving (Show, Read, Eq, Ord) -instance FromJSON InteractionDataApplicationCommandOptionSubcommand where+instance FromJSON OptionDataSubcommand where parseJSON = withObject- "InteractionDataApplicationCommandOptionSubcommand"+ "OptionDataSubcommand" ( \v -> do t <- v .: "type" :: Parser Int case t of 1 ->- InteractionDataApplicationCommandOptionSubcommand+ OptionDataSubcommand <$> v .: "name" <*> v .:? "options" .!= [] <*> v .:? "focused" .!= False@@ -376,96 +375,96 @@ ) -- | Data for a single value.-data InteractionDataApplicationCommandOptionValue- = InteractionDataApplicationCommandOptionValueString- { interactionDataApplicationCommandOptionValueName :: T.Text,- interactionDataApplicationCommandOptionValueStringValue :: Either T.Text T.Text+data OptionDataValue+ = OptionDataValueString+ { optionDataValueName :: T.Text,+ optionDataValueString :: Either T.Text T.Text }- | InteractionDataApplicationCommandOptionValueInteger- { interactionDataApplicationCommandOptionValueName :: T.Text,- interactionDataApplicationCommandOptionValueIntegerValue :: Either T.Text Integer+ | OptionDataValueInteger+ { optionDataValueName :: T.Text,+ optionDataValueInteger :: Either T.Text Integer }- | InteractionDataApplicationCommandOptionValueBoolean- { interactionDataApplicationCommandOptionValueName :: T.Text,- interactionDataApplicationCommandOptionValueBooleanValue :: Bool+ | OptionDataValueBoolean+ { optionDataValueName :: T.Text,+ optionDataValueBoolean :: Bool }- | InteractionDataApplicationCommandOptionValueUser- { interactionDataApplicationCommandOptionValueName :: T.Text,- interactionDataApplicationCommandOptionValueUserValue :: UserId+ | OptionDataValueUser+ { optionDataValueName :: T.Text,+ optionDataValueUser :: UserId }- | InteractionDataApplicationCommandOptionValueChannel- { interactionDataApplicationCommandOptionValueName :: T.Text,- interactionDataApplicationCommandOptionValueChannelValue :: ChannelId+ | OptionDataValueChannel+ { optionDataValueName :: T.Text,+ optionDataValueChannel :: ChannelId }- | InteractionDataApplicationCommandOptionValueRole- { interactionDataApplicationCommandOptionValueName :: T.Text,- interactionDataApplicationCommandOptionValueRoleValue :: RoleId+ | OptionDataValueRole+ { optionDataValueName :: T.Text,+ optionDataValueRole :: RoleId }- | InteractionDataApplicationCommandOptionValueMentionable- { interactionDataApplicationCommandOptionValueName :: T.Text,- interactionDataApplicationCommandOptionValueMentionableValue :: Snowflake+ | OptionDataValueMentionable+ { optionDataValueName :: T.Text,+ optionDataValueMentionable :: Snowflake }- | InteractionDataApplicationCommandOptionValueNumber- { interactionDataApplicationCommandOptionValueName :: T.Text,- interactionDataApplicationCommandOptionValueNumberValue :: Either T.Text Scientific+ | OptionDataValueNumber+ { optionDataValueName :: T.Text,+ optionDataValueNumber :: Either T.Text Number } deriving (Show, Read, Eq, Ord) -instance FromJSON InteractionDataApplicationCommandOptionValue where+instance FromJSON OptionDataValue where parseJSON = withObject- "InteractionDataApplicationCommandOptionValue"+ "OptionDataValue" ( \v -> do name <- v .: "name" focused <- v .:? "focused" .!= False t <- v .: "type" :: Parser Int case t of 3 ->- InteractionDataApplicationCommandOptionValueString name+ OptionDataValueString name <$> parseValue v focused 4 ->- InteractionDataApplicationCommandOptionValueInteger name+ OptionDataValueInteger name <$> parseValue v focused 10 ->- InteractionDataApplicationCommandOptionValueNumber name+ OptionDataValueNumber name <$> parseValue v focused 5 ->- InteractionDataApplicationCommandOptionValueBoolean name+ OptionDataValueBoolean name <$> v .: "value" 6 ->- InteractionDataApplicationCommandOptionValueUser name+ OptionDataValueUser name <$> v .: "value" 7 ->- InteractionDataApplicationCommandOptionValueChannel name+ OptionDataValueChannel name <$> v .: "value" 8 ->- InteractionDataApplicationCommandOptionValueRole name+ OptionDataValueRole name <$> v .: "value" 9 ->- InteractionDataApplicationCommandOptionValueMentionable name+ OptionDataValueMentionable name <$> v .: "value" _ -> fail $ "unexpected interaction data application command option value type: " ++ show t ) -data InteractionDataModal = InteractionDataModal+data ModalData = ModalData { -- | The unique id of the component (up to 100 characters).- interactionDataModalCustomId :: T.Text,+ modalDataCustomId :: T.Text, -- | Components from the modal.- interactionDataModalComponents :: [ComponentTextInput]+ modalDataComponents :: [TextInput] } deriving (Show, Read, Eq, Ord) -instance FromJSON InteractionDataModal where+instance FromJSON ModalData where parseJSON = withObject- "InteractionDataModal"+ "ModalData" ( \v ->- InteractionDataModal <$> v .: "custom_id"+ ModalData <$> v .: "custom_id" <*> ((v .: "components") >>= (join <$>) . mapM getTextInput) ) where- getTextInput :: Value -> Parser [ComponentTextInput]- getTextInput = withObject "InteractionDataModal.TextInput" $ \o -> do+ getTextInput :: Value -> Parser [TextInput]+ getTextInput = withObject "ModalData.TextInput" $ \o -> do t <- o .: "type" :: Parser Int case t of 1 -> o .: "components"@@ -555,7 +554,10 @@ toJSON (InteractionResponseAutocompleteResult ms) = object [("type", Number 8), ("data", toJSON ms)] toJSON (InteractionResponseModal ms) = object [("type", Number 9), ("data", toJSON ms)] -data InteractionResponseAutocomplete = InteractionResponseAutocompleteString [Choice T.Text] | InteractionResponseAutocompleteInteger [Choice Integer] | InteractionResponseAutocompleteNumber [Choice Scientific]+data InteractionResponseAutocomplete+ = InteractionResponseAutocompleteString [Choice T.Text]+ | InteractionResponseAutocompleteInteger [Choice Integer]+ | InteractionResponseAutocompleteNumber [Choice Number] deriving (Show, Read, Eq, Ord) instance ToJSON InteractionResponseAutocomplete where@@ -570,7 +572,7 @@ interactionResponseMessageEmbeds :: Maybe [CreateEmbed], interactionResponseMessageAllowedMentions :: Maybe AllowedMentions, interactionResponseMessageFlags :: Maybe InteractionResponseMessageFlags,- interactionResponseMessageComponents :: Maybe [ComponentActionRow],+ interactionResponseMessageComponents :: Maybe [ActionRow], interactionResponseMessageAttachments :: Maybe [Attachment] } deriving (Show, Read, Eq, Ord)@@ -617,7 +619,7 @@ data InteractionResponseModalData = InteractionResponseModalData { interactionResponseModalCustomId :: T.Text, interactionResponseModalTitle :: T.Text,- interactionResponseModalComponents :: [ComponentTextInput]+ interactionResponseModalComponents :: [TextInput] } deriving (Show, Read, Eq, Ord)
src/Discord/Internal/Types/Prelude.hs view
@@ -15,7 +15,6 @@ import qualified Data.Text as T import Data.Time.Clock.POSIX -import Data.Functor.Compose (Compose(Compose, getCompose)) import Data.Bifunctor (first) import Text.Read (readMaybe) import Data.Data (Data (dataTypeOf), dataTypeConstrs, fromConstr)@@ -32,14 +31,14 @@ in bot <> token -- | A unique integer identifier. Can be used to calculate the creation date of an entity.-newtype Snowflake = Snowflake Word64+newtype Snowflake = Snowflake { unSnowflake :: Word64 } deriving (Ord, Eq, Num, Integral, Enum, Real, Bits) instance Show Snowflake where show (Snowflake a) = show a instance Read Snowflake where- readsPrec p = getCompose $ first Snowflake <$> Compose (readsPrec p)+ readsPrec p = fmap (first Snowflake) . readsPrec p instance ToJSON Snowflake where toJSON (Snowflake snowflake) = String . T.pack $ show snowflake@@ -54,25 +53,84 @@ (Just i) -> pure i ) -type ChannelId = Snowflake-type StageId = Snowflake-type GuildId = Snowflake-type MessageId = Snowflake-type AttachmentId = Snowflake-type EmojiId = Snowflake-type StickerId = Snowflake-type UserId = Snowflake-type OverwriteId = Snowflake-type RoleId = Snowflake-type IntegrationId = Snowflake-type WebhookId = Snowflake-type ParentId = Snowflake-type ApplicationId = Snowflake-type ApplicationCommandId = Snowflake-type InteractionId = Snowflake-type ScheduledEventId = Snowflake-type ScheduledEventEntityId = Snowflake-type InteractionToken = T.Text+newtype DiscordId a = DiscordId { unId :: Snowflake }+ deriving (Ord, Eq, Num, Integral, Enum, Real, Bits)++instance Show (DiscordId a) where+ show = show . unId++instance Read (DiscordId a) where+ readsPrec p = fmap (first DiscordId) . readsPrec p++instance ToJSON (DiscordId a) where+ toJSON = toJSON . unId++instance FromJSON (DiscordId a) where+ parseJSON = fmap DiscordId . parseJSON++data ChannelIdType+type ChannelId = DiscordId ChannelIdType++data StageIdType+type StageId = DiscordId StageIdType++data GuildIdType+type GuildId = DiscordId GuildIdType++data MessageIdType+type MessageId = DiscordId MessageIdType++data AttachmentIdType+type AttachmentId = DiscordId AttachmentIdType++data EmojiIdType+type EmojiId = DiscordId EmojiIdType++data StickerIdType+type StickerId = DiscordId StickerIdType++data UserIdType+type UserId = DiscordId UserIdType++data OverwriteIdType+type OverwriteId = DiscordId OverwriteIdType++data RoleIdType+type RoleId = DiscordId RoleIdType++data IntegrationIdType+type IntegrationId = DiscordId IntegrationIdType++data WebhookIdType+type WebhookId = DiscordId WebhookIdType++data ParentIdType+type ParentId = DiscordId ParentIdType++data ApplicationIdType+type ApplicationId = DiscordId ApplicationIdType++data ApplicationCommandIdType+type ApplicationCommandId = DiscordId ApplicationCommandIdType++data InteractionIdType+type InteractionId = DiscordId InteractionIdType++data ScheduledEventIdType+type ScheduledEventId = DiscordId ScheduledEventIdType++data ScheduledEventEntityIdType+type ScheduledEventEntityId = DiscordId ScheduledEventEntityIdType++newtype InteractionToken = InteractionToken T.Text+ deriving (Show, Read, Eq, Ord)++instance ToJSON InteractionToken where+ toJSON (InteractionToken token) = String token++instance FromJSON InteractionToken where+ parseJSON = withText "InteractionToken" (pure . InteractionToken)+ type Shard = (Int, Int) -- | Gets a creation date from a snowflake.
src/Discord/Internal/Types/User.hs view
@@ -102,7 +102,7 @@ <*> o .: "name" <*> o .: "type" <*> o .: "revoked"- <*> sequence (map (.: "id") integrations)+ <*> mapM (.: "id") integrations <*> o .: "verified" <*> o .: "friend_sync" <*> o .: "show_activity"