packages feed

telegram-bot-api 7.4 → 7.4.1

raw patch · 12 files changed

+27/−17 lines, 12 files

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # telegram-bot-api +## 7.4.1 -- 2024-10-20++- Fix `inline_messaige_id` type representation (see [#191](https://github.com/fizruk/telegram-bot-simple/pull/191)).+ ## 7.4 -- 2024-06-02  - Types:
src/Telegram/Bot/API/Games.hs view
@@ -17,7 +17,7 @@ import Telegram.Bot.API.MakingRequests (Response) import Telegram.Bot.API.Types   ( BusinessConnectionId, ChatId, GameHighScore, InlineKeyboardMarkup-  , Message, MessageId, MessageThreadId+  , InlineMessageId, Message, MessageId, MessageThreadId   , ReplyParameters, UserId   ) import Telegram.Bot.API.Internal.TH@@ -49,7 +49,7 @@   , setGameScoreDisableEditMessage :: Maybe Bool      -- ^ Pass 'True', if the game message should not be automatically edited to include the current scoreboard.   , setGameScoreChatId             :: Maybe ChatId    -- ^ Required if @inline_message_id@ is not specified. Unique identifier for the target chat   , setGameScoreMessageId          :: Maybe MessageId -- ^ Required if @inline_message_id@ is not specified. Identifier of the sent message.-  , setGameScoreInlineMessageId    :: Maybe MessageId -- ^ Required if @chat_id@ and @message_id@ are not specified. Identifier of the inline message.+  , setGameScoreInlineMessageId    :: Maybe InlineMessageId -- ^ Required if @chat_id@ and @message_id@ are not specified. Identifier of the inline message.   }   deriving (Generic, Show) @@ -64,7 +64,7 @@   { getGameHighScoresUserId          :: UserId          -- ^ Target user id.   , getGameHighScoresChatId          :: Maybe ChatId    -- ^ Required if @inline_message_id@ is not specified. Unique identifier for the target chat.   , getGameHighScoresMessageId       :: Maybe MessageId -- ^ Required if @inline_message_id@ is not specified. Identifier of the sent message.-  , getGameHighScoresInlineMessageId :: Maybe MessageId -- ^ Required if @chat_id@ and @message_id@ are not specified. Identifier of the inline message.+  , getGameHighScoresInlineMessageId :: Maybe InlineMessageId -- ^ Required if @chat_id@ and @message_id@ are not specified. Identifier of the inline message.   }   deriving (Generic, Show) 
src/Telegram/Bot/API/InlineMode.hs view
@@ -67,7 +67,7 @@   { chosenInlineResultResultId        :: InlineQueryResultId -- ^ The unique identifier for the result that was chosen.   , chosenInlineResultFrom            :: User            -- ^ The user that chose the result.   , chosenInlineResultLocation        :: Maybe Location  -- ^ Sender location, only for bots that require user location.-  , chosenInlineResultInlineMessageId :: Maybe MessageId -- ^ Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message.+  , chosenInlineResultInlineMessageId :: Maybe InlineMessageId -- ^ Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message.   , chosenInlineResultQuery           :: InlineQueryId   -- ^ The query that was used to obtain the result.   } deriving (Generic, Show) 
src/Telegram/Bot/API/Methods/EditMessageLiveLocation.hs view
@@ -6,7 +6,6 @@  import Data.Aeson (FromJSON (..), ToJSON (..)) import Data.Proxy-import Data.Text import GHC.Generics (Generic) import Servant.API import Servant.Client hiding (Response)@@ -22,7 +21,7 @@ data EditMessageLiveLocationRequest = EditMessageLiveLocationRequest   { editMessageLiveLocationChatId :: Maybe SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format \@channelusername).   , editMessageLiveLocationMessageId :: Maybe MessageId -- ^ Required if inline_message_id is not specified. Identifier of the message with live location to stop.-  , editMessageLiveLocationInlineMessageId :: Maybe Text -- ^  	Required if chat_id and message_id are not specified. Identifier of the inline message.+  , editMessageLiveLocationInlineMessageId :: Maybe InlineMessageId -- ^ Required if chat_id and message_id are not specified. Identifier of the inline message.   , editMessageLiveLocationLatitude :: Float -- ^ Latitude of new location.   , editMessageLiveLocationLongitude :: Float -- ^ Longitude of new location.   , editMessageLiveLocationLivePeriod :: Maybe Int -- ^ New period in seconds during which the location can be updated, starting from the message send date. If @0x7FFFFFFF@ is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current @live_period@ by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then @live_period@ remains unchanged.
src/Telegram/Bot/API/Methods/SendDocument.hs view
@@ -115,7 +115,9 @@       = (FileData "file" (T.pack $ takeFileName path) ct path)       : maybe [] (\t -> [FileData "thumbnail" (T.pack $ takeFileName t) "image/jpeg" t]) sendDocumentThumbnail -    DocumentFile path ct = sendDocumentDocument+    (path, ct) = case sendDocumentDocument of+      DocumentFile path' ct' -> (path', ct')+      _ -> error "ToMultipart Tmp SendDocumentRequest: cannot use multipart for links or file ids"   instance ToJSON   SendDocumentRequest where toJSON = gtoJSON
src/Telegram/Bot/API/Methods/SendPhoto.hs view
@@ -104,7 +104,9 @@       = (FileData "file" (T.pack $ takeFileName path) ct path)       : maybe [] (\t -> [FileData "thumb" (T.pack $ takeFileName t) "image/jpeg" t]) sendPhotoThumb -    PhotoFile path ct = sendPhotoPhoto+    (path, ct) = case sendPhotoPhoto of+      PhotoFile path' ct' -> (path', ct')+      _ -> error "ToMultipart Tmp SendPhotoRequest: cannot use multipart for links or file ids"  instance ToJSON SendPhotoRequest where toJSON = gtoJSON 
src/Telegram/Bot/API/Methods/StopMessageLiveLocation.hs view
@@ -22,7 +22,7 @@ data StopMessageLiveLocationRequest = StopMessageLiveLocationRequest   { stopMessageLiveLocationChatId :: Maybe SomeChatId -- ^ Unique identifier for the target chat or username of the target channel (in the format @channelusername)   , stopMessageLiveLocationMessageId :: Maybe MessageId -- ^ Required if inline_message_id is not specified. Identifier of the message with live location to stop-  , stopMessageLiveLocationInlineMessageId :: Maybe Text -- ^  	Required if chat_id and message_id are not specified. Identifier of the inline message+  , stopMessageLiveLocationInlineMessageId :: Maybe InlineMessageId -- ^ Required if chat_id and message_id are not specified. Identifier of the inline message   , stopMessageLiveLocationReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.   }   deriving Generic
src/Telegram/Bot/API/Types/CallbackQuery.hs view
@@ -22,7 +22,7 @@   { callbackQueryId              :: CallbackQueryId -- ^ Unique identifier for this query   , callbackQueryFrom            :: User -- ^ Sender   , callbackQueryMessage         :: Maybe Message -- ^ Message sent by the bot with the callback button that originated the query. Use 'isInaccessible' to understand whether a message was deleted or is otherwise inaccessible to the bot.-  , callbackQueryInlineMessageId :: Maybe MessageId -- ^ Identifier of the message sent via the bot in inline mode, that originated the query.+  , callbackQueryInlineMessageId :: Maybe InlineMessageId -- ^ Identifier of the message sent via the bot in inline mode, that originated the query.   , callbackQueryChatInstance    :: Text -- ^ Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.   , callbackQueryData            :: Maybe Text -- ^ Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field.   , callbackQueryGameShortName   :: Maybe Text -- ^ Short name of a Game to be returned, serves as the unique identifier for the game
src/Telegram/Bot/API/Types/Common.hs view
@@ -58,6 +58,9 @@ instance ToHttpApiData MessageThreadId where   toUrlPiece a = pack . show @Integer $ coerce a +newtype InlineMessageId = InlineMessageId Text+  deriving (Eq, Show, ToJSON, FromJSON, Hashable)+ -- | The unique identifier of a media message group a message belongs to. newtype MediaGroupId = MediaGroupId Text   deriving (Eq, Show, ToJSON, FromJSON)
src/Telegram/Bot/API/UpdatingMessages.hs view
@@ -34,7 +34,7 @@ data EditMessageTextRequest = EditMessageTextRequest   { editMessageTextChatId                :: Maybe SomeChatId -- ^ Required if 'editMessageTextInlineMessageId' is not specified. Unique identifier for the target chat or username of the target channel (in the format @\@channelusername@).   , editMessageTextMessageId             :: Maybe MessageId -- ^ Required if 'editMessageTextInlineMessageId' is not specified. Identifier of the sent message.-  , editMessageTextInlineMessageId       :: Maybe MessageId -- ^ Required if 'editMessageTextChatId' and 'editMessageTextMessageId' are not specified. Identifier of the sent message.+  , editMessageTextInlineMessageId       :: Maybe InlineMessageId -- ^ Required if 'editMessageTextChatId' and 'editMessageTextMessageId' are not specified. Identifier of the sent message.   , editMessageTextText                  :: Text -- ^ Text of the message to be sent.   , editMessageTextParseMode             :: Maybe ParseMode -- ^ Send 'MarkdownV2', 'HTML' or 'Markdown' (legacy), if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.   , editMessageEntities                  :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in message text, which can be specified instead of /parse_mode/.@@ -46,7 +46,7 @@ data EditMessageCaptionRequest = EditMessageCaptionRequest   { editMessageCaptionChatId           :: Maybe SomeChatId -- ^ Required if 'editMessageCaptionMessageId' is not specified. Unique identifier for the target chat or username of the target channel (in the format @\@channelusername@).   , editMessageCaptionMessageId        :: Maybe MessageId -- ^ Required if 'editMessageCaptionInlineMessageId' is not specified. Identifier of the sent message.-  , editMessageCaptionInlineMessageId  :: Maybe MessageId -- ^ Required if 'editMessageCaptionChatId' and 'editMessageCaptionMessageId' are not specified. Identifier of the sent message.+  , editMessageCaptionInlineMessageId  :: Maybe InlineMessageId -- ^ Required if 'editMessageCaptionChatId' and 'editMessageCaptionMessageId' are not specified. Identifier of the sent message.   , editMessageCaptionCaption          :: Maybe Text -- ^ New caption of the message, 0-1024 characters after entities parsing   , editMessageCaptionParseMode        :: Maybe ParseMode -- ^ Mode for parsing entities in the message caption. See formatting options for more details.   , editMessageCaptionCaptionEntities  :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the caption, which can be specified instead of @parse_mode@.@@ -58,7 +58,7 @@ data EditMessageMediaRequest = EditMessageMediaRequest   { editMessageMediaChatId           :: Maybe SomeChatId -- ^ Required if 'editMessageMediaMessageId' is not specified. Unique identifier for the target chat or username of the target channel (in the format @\@channelusername@).   , editMessageMediaMessageId        :: Maybe MessageId -- ^ Required if 'editMessageMediaInlineMessageId' is not specified. Identifier of the sent message.-  , editMessageMediaInlineMessageId  :: Maybe MessageId -- ^ Required if 'editMessageMediaChatId' and 'editMessageMediaMessageId' are not specified. Identifier of the sent message.+  , editMessageMediaInlineMessageId  :: Maybe InlineMessageId -- ^ Required if 'editMessageMediaChatId' and 'editMessageMediaMessageId' are not specified. Identifier of the sent message.   , editMessageMediaMedia            :: InputMedia -- ^ A JSON-serialized object for a new media content of the message   , editMessageMediaReplyMarkup      :: Maybe SomeReplyMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. } deriving (Generic)@@ -69,7 +69,7 @@ data EditMessageReplyMarkupRequest = EditMessageReplyMarkupRequest   { editMessageReplyMarkupChatId           :: Maybe SomeChatId -- ^ Required if 'editMessageReplyMarkupMessageId' is not specified. Unique identifier for the target chat or username of the target channel (in the format @\@channelusername@).   , editMessageReplyMarkupMessageId        :: Maybe MessageId -- ^ Required if 'editMessageReplyMarkupInlineMessageId' is not specified. Identifier of the sent message.-  , editMessageReplyMarkupInlineMessageId  :: Maybe MessageId -- ^ Required if 'editMessageReplyMarkupChatId' and 'editMessageReplyMarkupMessageId' are not specified. Identifier of the sent message.+  , editMessageReplyMarkupInlineMessageId  :: Maybe InlineMessageId -- ^ Required if 'editMessageReplyMarkupChatId' and 'editMessageReplyMarkupMessageId' are not specified. Identifier of the sent message.   , editMessageReplyMarkupReplyMarkup      :: Maybe SomeReplyMarkup -- ^ Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. } deriving (Generic) 
src/Telegram/Bot/API/WebApps.hs view
@@ -15,7 +15,7 @@  import Telegram.Bot.API.Internal.Utils (deriveJSON') import Telegram.Bot.API.MakingRequests (Response)-import Telegram.Bot.API.InlineMode (InlineQueryId)+import Telegram.Bot.API.Types.Common (InlineMessageId) import Telegram.Bot.API.InlineMode.InlineQueryResult (InlineQueryResult) import Telegram.Bot.API.Internal.TH (makeDefault) @@ -33,7 +33,7 @@  -- | Contains information about an inline message sent by a Web App on behalf of a user. newtype SentWebAppMessage = SentWebAppMessage-  { sentWebAppMessageInlineMessageId :: Maybe InlineQueryId+  { sentWebAppMessageInlineMessageId :: Maybe InlineMessageId   }   deriving (Generic, Show) 
telegram-bot-api.cabal view
@@ -1,7 +1,7 @@ cabal-version: 1.12  name:           telegram-bot-api-version:        7.4+version:        7.4.1 synopsis:       Easy to use library for building Telegram bots. Exports Telegram Bot API. description:    Please see the README on Github at <https://github.com/fizruk/telegram-bot-simple#readme>                 .