diff --git a/telegram-bot-api/src/Telegram/Bot/API/Forum.hs b/telegram-bot-api/src/Telegram/Bot/API/Forum.hs index 9e67ec3..bebf45a 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Forum.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Forum.hs @@ -188,7 +188,7 @@ editGeneralForumTopic = client (Proxy @EditGeneralForumTopic) -- ** 'closeGeneralForumTopic' -data CloseGeneralForumTopicRequest = CloseGeneralForumTopicRequest +newtype CloseGeneralForumTopicRequest = CloseGeneralForumTopicRequest { closeGeneralForumTopicChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). } deriving Generic @@ -206,7 +206,7 @@ closeGeneralForumTopic = client (Proxy @CloseGeneralForumTopic) -- ** 'reopenGeneralForumTopic' -data ReopenGeneralForumTopicRequest = ReopenGeneralForumTopicRequest +newtype ReopenGeneralForumTopicRequest = ReopenGeneralForumTopicRequest { reopenGeneralForumTopicRequestChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). } deriving Generic @@ -224,7 +224,7 @@ reopenGeneralForumTopic = client (Proxy @ReopenGeneralForumTopic) -- ** 'hideGeneralForumTopic' -data HideGeneralForumTopicRequest = HideGeneralForumTopicRequest +newtype HideGeneralForumTopicRequest = HideGeneralForumTopicRequest { hideGeneralForumTopicChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). } deriving Generic @@ -242,7 +242,7 @@ hideGeneralForumTopic = client (Proxy @HideGeneralForumTopic) -- ** 'unhideGeneralForumTopic' -data UnhideGeneralForumTopicRequest = UnhideGeneralForumTopicRequest +newtype UnhideGeneralForumTopicRequest = UnhideGeneralForumTopicRequest { unhideGeneralForumTopicChatId :: SomeChatId -- ^ Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) } deriving Generic diff --git a/telegram-bot-api/src/Telegram/Bot/API/Internal/TH.hs b/telegram-bot-api/src/Telegram/Bot/API/Internal/TH.hs index a3801e2..049c739 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Internal/TH.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Internal/TH.hs @@ -63,7 +63,7 @@ constructType :: Name -> [Type] -> Q Type constructType typeN tys = foldr arrAp baseTy (filter (not . isMaybeTy) tys) where baseTy = conT typeN - arrAp a b = appT (appT arrowT (pure a)) b + arrAp a = appT (appT arrowT (pure a)) -- Predicates over TH diff --git a/telegram-bot-api/src/Telegram/Bot/API/Internal/Utils.hs b/telegram-bot-api/src/Telegram/Bot/API/Internal/Utils.hs index 8ed7114..622d3ef 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Internal/Utils.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Internal/Utils.hs @@ -4,7 +4,6 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} -{-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE CPP #-} module Telegram.Bot.API.Internal.Utils where @@ -95,7 +94,7 @@ instance GSomeJSON f => GSomeJSON (D1 d f) where instance (ToJSON a, FromJSON a) => GSomeJSON (C1 c (S1 s (K1 i a))) where gsomeToJSON (M1 (M1 (K1 x))) = toJSON x - gsomeParseJSON js = (M1 . M1 . K1) <$> parseJSON js + gsomeParseJSON js = M1 . M1 . K1 <$> parseJSON js instance (GSomeJSON f, GSomeJSON g) => GSomeJSON (f :+: g) where gsomeToJSON (L1 x) = gsomeToJSON x diff --git a/telegram-bot-api/src/Telegram/Bot/API/Methods.hs b/telegram-bot-api/src/Telegram/Bot/API/Methods.hs index d6861ce..032cbf8 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Methods.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Methods.hs @@ -1,18 +1,10 @@ -{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DataKinds #-} -{-# LANGUAGE DeriveGeneric #-} -{-# LANGUAGE TypeApplications #-} -{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE TypeOperators #-} {-# LANGUAGE DerivingStrategies #-} -{-# LANGUAGE PatternSynonyms #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE TemplateHaskell #-} module Telegram.Bot.API.Methods ( module Telegram.Bot.API.Types.ParseMode , module Telegram.Bot.API.Types.SomeReplyMarkup - + , module Telegram.Bot.API.Methods.AnswerCallbackQuery , module Telegram.Bot.API.Methods.ApproveChatJoinRequest , module Telegram.Bot.API.Methods.BanChatMember diff --git a/telegram-bot-api/src/Telegram/Bot/API/Methods/GetChatMenuButton.hs b/telegram-bot-api/src/Telegram/Bot/API/Methods/GetChatMenuButton.hs index 3febf01..77dd68a 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Methods/GetChatMenuButton.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Methods/GetChatMenuButton.hs @@ -18,7 +18,7 @@ import Telegram.Bot.API.Internal.TH -- ** 'getChatMenuButton' -- | Request parameters for 'getChatMenuButton'. -data GetChatMenuButtonRequest = GetChatMenuButtonRequest +newtype GetChatMenuButtonRequest = GetChatMenuButtonRequest { getChatMenuButtonRequestChatId :: Maybe ChatId -- ^ Unique identifier for the target private chat. If not specified, default bot's menu button will be returned. } deriving Generic diff --git a/telegram-bot-api/src/Telegram/Bot/API/Methods/SendDocument.hs b/telegram-bot-api/src/Telegram/Bot/API/Methods/SendDocument.hs index 1a7dae6..05cf982 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Methods/SendDocument.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Methods/SendDocument.hs @@ -94,25 +94,25 @@ pattern DocumentFile x y = MakeDocumentFile (InputFile x y) instance ToMultipart Tmp SendDocumentRequest where toMultipart SendDocumentRequest{..} = MultipartData fields files where fields = - [ Input "document" $ T.pack $ "attach://file" + [ Input "document" "attach://file" , Input "chat_id" $ case sendDocumentChatId of SomeChatId (ChatId chat_id) -> T.pack $ show chat_id SomeChatUsername txt -> txt ] <> - ( (maybe id (\t -> ((Input "message_thread_id") (T.pack $ show t):)) sendDocumentMessageThreadId) - $ (maybe id (\_ -> ((Input "thumbnail" "attach://thumbnail"):)) sendDocumentThumbnail) - $ (maybe id (\t -> ((Input "caption" t):)) sendDocumentCaption) - $ (maybe id (\t -> ((Input "parse_mode" (TL.toStrict $ encodeToLazyText t)):)) sendDocumentParseMode) - $ (maybe id (\t -> ((Input "caption_entities" (TL.toStrict $ encodeToLazyText t)):)) sendDocumentCaptionEntities) - $ (maybe id (\t -> ((Input "disable_notification" (bool "false" "true" t)):)) sendDocumentDisableNotification) - $ (maybe id (\t -> ((Input "disable_content_type_detection" (bool "false" "true" t)):)) sendDocumentDisableContentTypeDetection) - $ (maybe id (\t -> ((Input "protect_content" (bool "false" "true" t)):)) sendDocumentProtectContent) - $ (maybe id (\t -> ((Input "reply_to_message_id" (TL.toStrict $ encodeToLazyText t)):)) sendDocumentReplyToMessageId) - $ (maybe id (\t -> ((Input "reply_parameters" (TL.toStrict $ encodeToLazyText t)):)) sendDocumentReplyParameters) - $ (maybe id (\t -> ((Input "reply_markup" (TL.toStrict $ encodeToLazyText t)):)) sendDocumentReplyMarkup) + maybe id (\t -> (Input "message_thread_id" (T.pack $ show t) :)) sendDocumentMessageThreadId + ( maybe id (const (Input "thumbnail" "attach://thumbnail" :)) sendDocumentThumbnail + $ maybe id (\t -> (Input "caption" t :)) sendDocumentCaption + $ maybe id (\t -> (Input "parse_mode" (TL.toStrict $ encodeToLazyText t) :)) sendDocumentParseMode + $ maybe id (\t -> (Input "caption_entities" (TL.toStrict $ encodeToLazyText t) :)) sendDocumentCaptionEntities + $ maybe id (\t -> (Input "disable_notification" (bool "false" "true" t) :)) sendDocumentDisableNotification + $ maybe id (\t -> (Input "disable_content_type_detection" (bool "false" "true" t) :)) sendDocumentDisableContentTypeDetection + $ maybe id (\t -> (Input "protect_content" (bool "false" "true" t) :)) sendDocumentProtectContent + $ maybe id (\t -> (Input "reply_to_message_id" (TL.toStrict $ encodeToLazyText t) :)) sendDocumentReplyToMessageId + $ maybe id (\t -> (Input "reply_parameters" (TL.toStrict $ encodeToLazyText t) :)) sendDocumentReplyParameters + $ maybe id (\t -> (Input "reply_markup" (TL.toStrict $ encodeToLazyText t) :)) sendDocumentReplyMarkup []) files - = (FileData "file" (T.pack $ takeFileName path) ct path) + = FileData "file" (T.pack $ takeFileName path) ct path : maybe [] (\t -> [FileData "thumbnail" (T.pack $ takeFileName t) "image/jpeg" t]) sendDocumentThumbnail (path, ct) = case sendDocumentDocument of diff --git a/telegram-bot-api/src/Telegram/Bot/API/Methods/SendPhoto.hs b/telegram-bot-api/src/Telegram/Bot/API/Methods/SendPhoto.hs index 2ee26e4..3b99fee 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Methods/SendPhoto.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Methods/SendPhoto.hs @@ -83,25 +83,25 @@ data SendPhotoRequest = SendPhotoRequest instance ToMultipart Tmp SendPhotoRequest where toMultipart SendPhotoRequest{..} = MultipartData fields files where fields = - [ Input "photo" $ T.pack $ "attach://file" + [ Input "photo" "attach://file" , Input "chat_id" $ case sendPhotoChatId of SomeChatId (ChatId chat_id) -> T.pack $ show chat_id SomeChatUsername txt -> txt ] <> - ( (maybe id (\t -> ((Input "message_thread_id" (T.pack $ show t)):)) sendPhotoMessageThreadId) - $ (maybe id (\_ -> ((Input "thumb" "attach://thumb"):)) sendPhotoThumb) - $ (maybe id (\t -> ((Input "caption" t):)) sendPhotoCaption) - $ (maybe id (\t -> ((Input "parse_mode" (TL.toStrict . TL.replace "\"" "" $ encodeToLazyText t)):)) sendPhotoParseMode) - $ (maybe id (\t -> ((Input "caption_entities" (TL.toStrict $ encodeToLazyText t)):)) sendPhotoCaptionEntities) - $ (maybe id (\t -> ((Input "has_spoiler" (bool "false" "true" t)):)) sendPhotoHasSpoiler) - $ (maybe id (\t -> ((Input "disable_notification" (bool "false" "true" t)):)) sendPhotoDisableNotification) - $ (maybe id (\t -> ((Input "protect_content" (bool "false" "true" t)):)) sendPhotoProtectContent) - $ (maybe id (\t -> ((Input "reply_to_message_id" (TL.toStrict $ encodeToLazyText t)):)) sendPhotoReplyToMessageId) - $ (maybe id (\t -> ((Input "reply_parameters" (TL.toStrict $ encodeToLazyText t)):)) sendPhotoReplyParameters) - $ (maybe id (\t -> ((Input "reply_markup" (TL.toStrict $ encodeToLazyText t)):)) sendPhotoReplyMarkup) + maybe id (\t -> (Input "message_thread_id" (T.pack $ show t) :)) sendPhotoMessageThreadId + ( maybe id (const (Input "thumb" "attach://thumb" :)) sendPhotoThumb + $ maybe id (\t -> (Input "caption" t :)) sendPhotoCaption + $ maybe id (\t -> (Input "parse_mode" (TL.toStrict . TL.replace "\"" "" $ encodeToLazyText t) :)) sendPhotoParseMode + $ maybe id (\t -> (Input "caption_entities" (TL.toStrict $ encodeToLazyText t) :)) sendPhotoCaptionEntities + $ maybe id (\t -> (Input "has_spoiler" (bool "false" "true" t) :)) sendPhotoHasSpoiler + $ maybe id (\t -> (Input "disable_notification" (bool "false" "true" t) :)) sendPhotoDisableNotification + $ maybe id (\t -> (Input "protect_content" (bool "false" "true" t) :)) sendPhotoProtectContent + $ maybe id (\t -> (Input "reply_to_message_id" (TL.toStrict $ encodeToLazyText t) :)) sendPhotoReplyToMessageId + $ maybe id (\t -> (Input "reply_parameters" (TL.toStrict $ encodeToLazyText t) :)) sendPhotoReplyParameters + $ maybe id (\t -> (Input "reply_markup" (TL.toStrict $ encodeToLazyText t) :)) sendPhotoReplyMarkup []) files - = (FileData "file" (T.pack $ takeFileName path) ct path) + = FileData "file" (T.pack $ takeFileName path) ct path : maybe [] (\t -> [FileData "thumb" (T.pack $ takeFileName t) "image/jpeg" t]) sendPhotoThumb (path, ct) = case sendPhotoPhoto of diff --git a/telegram-bot-api/src/Telegram/Bot/API/Methods/SetStickerSetTitle.hs b/telegram-bot-api/src/Telegram/Bot/API/Methods/SetStickerSetTitle.hs index ab4268e..7407b2d 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Methods/SetStickerSetTitle.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Methods/SetStickerSetTitle.hs @@ -1,5 +1,4 @@ {-# LANGUAGE DataKinds #-} -{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeOperators #-} module Telegram.Bot.API.Methods.SetStickerSetTitle where @@ -23,4 +22,4 @@ type SetStickerSetTitle = "setStickerSetTitle" setStickerSetTitle :: Text -- ^ Sticker set name -> Text -- ^ Sticker set title, 1-64 characters -> ClientM (Response Bool) -setStickerSetTitle = client (Proxy @SetStickerSetTitle) \ No newline at end of file +setStickerSetTitle = client (Proxy @SetStickerSetTitle) diff --git a/telegram-bot-api/src/Telegram/Bot/API/Passport.hs b/telegram-bot-api/src/Telegram/Bot/API/Passport.hs index ec9aeaa..ca86210 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Passport.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Passport.hs @@ -1,6 +1,5 @@ {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeOperators #-} -{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DataKinds #-} module Telegram.Bot.API.Passport where diff --git a/telegram-bot-api/src/Telegram/Bot/API/Stickers.hs b/telegram-bot-api/src/Telegram/Bot/API/Stickers.hs index a122faf..78815fb 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Stickers.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Stickers.hs @@ -106,7 +106,7 @@ sendSticker r = -- ** 'getCustomEmojiStickers' -- | Request parameters for 'getCustomEmojiStickers'. -data GetCustomEmojiStickersRequest = GetCustomEmojiStickersRequest +newtype GetCustomEmojiStickersRequest = GetCustomEmojiStickersRequest { getCustomEmojiStickersRequestCustomEmojiIds :: [Text] -- ^ List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified. } deriving Generic diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types.hs b/telegram-bot-api/src/Telegram/Bot/API/Types.hs index 9419ee0..b1b9aae 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types.hs @@ -1,18 +1,11 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE DataKinds #-} -{-# LANGUAGE DeriveGeneric #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE TemplateHaskell #-} -{-# LANGUAGE TypeApplications #-} -{-# LANGUAGE LambdaCase #-} {-# LANGUAGE BlockArguments #-} {-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE MultiParamTypeClasses #-} module Telegram.Bot.API.Types - ( RequiredQueryParam + ( RequiredQueryParam , module Telegram.Bot.API.Types.Animation , module Telegram.Bot.API.Types.Audio , module Telegram.Bot.API.Types.BotCommand @@ -268,7 +261,7 @@ type RequiredQueryParam = QueryParam' '[Required , Strict] -- * Games -- | Your bot can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats. Create games via @BotFather using the /newgame command. Please note that this kind of power requires responsibility: you will need to accept the terms for each game that your bots will be offering. --- +-- -- Games are a new type of content on Telegram, represented by the Game and InlineQueryResultGame objects. -- Once you've created a game via BotFather, you can send games to chats as regular messages using the sendGame method, or use inline mode with InlineQueryResultGame. -- If you send the game message without any buttons, it will automatically have a 'Play GameName' button. When this button is pressed, your bot gets a CallbackQuery with the game_short_name of the requested game. You provide the correct URL for this particular user and the app opens the game in the in-app browser. diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/Birthdate.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/Birthdate.hs index c157152..cec31fe 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types/Birthdate.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/Birthdate.hs @@ -1,5 +1,4 @@ {-# LANGUAGE DeriveGeneric #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Telegram.Bot.API.Types.Birthdate where import Data.Aeson (FromJSON (..), ToJSON (..)) diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/BotCommandScope.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/BotCommandScope.hs index 339025d..d4c730b 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types/BotCommandScope.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/BotCommandScope.hs @@ -1,5 +1,4 @@ {-# LANGUAGE BlockArguments #-} -{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module Telegram.Bot.API.Types.BotCommandScope where diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/BotShortDescription.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/BotShortDescription.hs index b9b4b67..8bb2d1e 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types/BotShortDescription.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/BotShortDescription.hs @@ -9,7 +9,7 @@ import Telegram.Bot.API.Internal.Utils -- ** 'BotShortDescription' -- | This object represents the bot's short description. -data BotShortDescription = BotShortDescription +newtype BotShortDescription = BotShortDescription { botShortDescriptionShortDescription :: Text -- ^ The bot's short description. } deriving (Generic, Show) diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/ChatBackground.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/ChatBackground.hs index 053e163..25d178c 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types/ChatBackground.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/ChatBackground.hs @@ -10,7 +10,7 @@ import Telegram.Bot.API.Types.BackgroundType -- ** 'ChatBackground' -- | This object represents a chat background. -data ChatBackground = ChatBackground +newtype ChatBackground = ChatBackground { chatBackgroundType :: BackgroundType -- ^ Type of the background. } deriving (Generic, Show) diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/ChatBoostAdded.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/ChatBoostAdded.hs index 74263f0..05299bd 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types/ChatBoostAdded.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/ChatBoostAdded.hs @@ -9,7 +9,7 @@ import Telegram.Bot.API.Internal.Utils -- ** 'ChatBoostAdded' -- | This object represents a boost added to a chat or changed. -data ChatBoostAdded = ChatBoostAdded +newtype ChatBoostAdded = ChatBoostAdded { chatBoostAddedBoostCount :: Int -- ^ Number of boosts added by the user. } deriving (Generic, Show) diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/Common.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/Common.hs index d7749a0..94995de 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types/Common.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/Common.hs @@ -2,7 +2,6 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} module Telegram.Bot.API.Types.Common where diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/CopyMessageId.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/CopyMessageId.hs index c9ac830..b4a360d 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types/CopyMessageId.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/CopyMessageId.hs @@ -10,7 +10,7 @@ import Telegram.Bot.API.Internal.Utils -- ** 'CopyMessageId' -- | This object represents result of copyMessage request. -data CopyMessageId = CopyMessageId +newtype CopyMessageId = CopyMessageId { copyMessageIdMessageId :: MessageId -- ^ the MessageId of the sent message. } deriving (Generic, Show) diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/InlineKeyboardMarkup.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/InlineKeyboardMarkup.hs index dcd06ba..abd5f2c 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types/InlineKeyboardMarkup.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/InlineKeyboardMarkup.hs @@ -11,12 +11,12 @@ import Telegram.Bot.API.Internal.Utils -- | This object represents an inline keyboard that appears -- right next to the message it belongs to. -data InlineKeyboardMarkup = InlineKeyboardMarkup +newtype InlineKeyboardMarkup = InlineKeyboardMarkup { inlineKeyboardMarkupInlineKeyboard :: [[InlineKeyboardButton]] -- ^ Array of button rows, each represented by an Array of InlineKeyboardButton objects } deriving (Generic, Show) --- ^ +-- ^ -- **Note**: This will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message. instance ToJSON InlineKeyboardMarkup where toJSON = gtoJSON diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/MessageAutoDeleteTimerChanged.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/MessageAutoDeleteTimerChanged.hs index bbb3ae2..3faa45c 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types/MessageAutoDeleteTimerChanged.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/MessageAutoDeleteTimerChanged.hs @@ -10,7 +10,7 @@ import Telegram.Bot.API.Internal.Utils -- ** 'MessageAutoDeleteTimerChanged' -- | This object represents a service message about a change in auto-delete timer settings. -data MessageAutoDeleteTimerChanged = MessageAutoDeleteTimerChanged +newtype MessageAutoDeleteTimerChanged = MessageAutoDeleteTimerChanged { messageAutoDeleteTimerChangedMessageAutoDeleteTime :: Seconds -- ^ New auto-delete time for messages in the chat; in seconds } deriving (Generic, Show) diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/ReactionType.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/ReactionType.hs index 0ebd643..1a2fda0 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types/ReactionType.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/ReactionType.hs @@ -1,5 +1,4 @@ {-# LANGUAGE BlockArguments #-} -{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module Telegram.Bot.API.Types.ReactionType where @@ -16,7 +15,7 @@ import qualified Data.Text as Text -- ** 'ReactionType' -- | This object describes the type of a reaction. Currently, it can be one of --- +-- -- * 'ReactionTypeEmoji', -- * 'ReactionTypeCustomEmoji'. -- diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/VideoChatEnded.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/VideoChatEnded.hs index 2b7e78e..6ff6c1f 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types/VideoChatEnded.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/VideoChatEnded.hs @@ -11,7 +11,7 @@ import Telegram.Bot.API.Internal.Utils -- ** 'VideoChatEnded' -- | This object represents a service message about a video chat ended in the chat. -data VideoChatEnded = VideoChatEnded +newtype VideoChatEnded = VideoChatEnded { videoChatEndedDuration :: Seconds -- ^ Video chat duration in seconds. } deriving (Generic, Show) @@ -22,7 +22,7 @@ instance FromJSON VideoChatEnded where parseJSON = gparseJSON -- ** 'VideoChatParticipantsInvited' -data VideoChatParticipantsInvited = VideoChatParticipantsInvited +newtype VideoChatParticipantsInvited = VideoChatParticipantsInvited { videoChatParticipantsInvitedUsers :: Maybe [User] -- ^ New members that were invited to the video chat. } deriving (Generic, Show) diff --git a/telegram-bot-api/src/Telegram/Bot/API/Types/VideoChatScheduled.hs b/telegram-bot-api/src/Telegram/Bot/API/Types/VideoChatScheduled.hs index 4da3d2c..739db5f 100644 --- a/telegram-bot-api/src/Telegram/Bot/API/Types/VideoChatScheduled.hs +++ b/telegram-bot-api/src/Telegram/Bot/API/Types/VideoChatScheduled.hs @@ -10,7 +10,7 @@ import Telegram.Bot.API.Internal.Utils -- ** 'VideoChatScheduled' -- | This object represents a service message about a video chat scheduled in the chat. -data VideoChatScheduled = VideoChatScheduled +newtype VideoChatScheduled = VideoChatScheduled { videoChatScheduledStartDate :: POSIXTime -- ^ Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator. } deriving (Generic, Show)