Skip to content

Commit

Permalink
Support Bot API 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
swamp-agr committed Jun 2, 2024
1 parent 53f37ef commit 38f9c22
Show file tree
Hide file tree
Showing 24 changed files with 72 additions and 22 deletions.
1 change: 1 addition & 0 deletions telegram-bot-api/src/Telegram/Bot/API/Games.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ data SendGameRequest = SendGameRequest
, sendGameGameShortName :: Text -- ^ Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
, sendGameDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
, sendGameProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving.
, sendGameMessageEffectId :: Maybe Text -- ^ Unique identifier of the message effect to be added to the message; for private chats only.
, sendGameReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.
, sendGameReplyParameters :: Maybe ReplyParameters -- ^ Description of the message to reply to.
, sendGameReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ data InlineQueryResultGeneric = InlineQueryResultGeneric
, inlineQueryResultCaption :: Maybe Text -- ^ Caption of the media to be sent, 0-1024 characters after entities parsing.
, inlineQueryResultParseMode :: Maybe Text -- ^ Mode for parsing entities in the photo caption. See formatting options <https:\/\/core.telegram.org\/bots\/api#formatting-options> for more details.
, inlineQueryResultCaptionEntities :: Maybe [MessageEntity] -- ^ List of special entities that appear in the caption, which can be specified instead of @parse_mode@.
, inlineQueryResultShowCaptionAboveMedia :: Maybe Bool -- ^ Pass 'True', if the caption must be shown above the message media.
, inlineQueryResultReplyMarkup :: Maybe InlineKeyboardMarkup -- ^ Inline keyboard attached to the message.
, inlineQueryResultInputMessageContent :: Maybe InputMessageContent -- ^ Content of the message to be sent instead of the media.
, inlineQueryResultDescription :: Maybe Text -- ^ Short description of the result.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ data InputMessageContent
{ inputMessageContentTitle :: Text -- ^ Product name, 1-32 characters.
, inputMessageContentDescription :: Text -- ^ Product description, 1-255 characters.
, inputMessageContentPayload :: Text -- ^ Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
, inputMessageContentProviderToken :: Text -- ^ Payment provider token, obtained via [@BotFather](https://t.me/botfather).
, inputMessageContentProviderToken :: Text -- ^ Payment provider token, obtained via [@BotFather](https://t.me/botfather). Pass an empty string for payments in [Telegram Stars](https://t.me/BotNews/90).
, inputMessageContentCurrency :: Text -- ^ Three-letter ISO 4217 currency code, see [more on currencies](https://core.telegram.org/bots/payments#supported-currencies).
, inputMessageContentPrices :: [LabeledPrice] -- ^ Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.).
, inputMessageContentMaxTipAmount :: Maybe Integer -- ^ The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of @US$ 1.45@ pass @max_tip_amount = 145@. See the exp parameter in [currencies.json](https://core.telegram.org/bots/payments/currencies.json), it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0.
Expand Down
3 changes: 2 additions & 1 deletion telegram-bot-api/src/Telegram/Bot/API/Methods/CopyMessage.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ data CopyMessageRequest = CopyMessageRequest
, copyMessageMessageId :: MessageId -- ^ Message identifier in the chat specified in from_chat_id
, copyMessageCaption :: Maybe Text -- ^ New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
, copyMessageParseMode :: 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.
, copyMessageCaptionEntities :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
, copyMessageCaptionEntities :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the caption, which can be specified instead of @parse_mode@.
, copyMessageShowCaptionAboveMedia :: Maybe Bool -- ^ Pass 'True', if the caption must be shown above the message media.
, copyMessageDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
, copyMessageProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
, copyMessageReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ data SendAnimationRequest = SendAnimationRequest
, sendAnimationThumbnail :: Maybe InputFile -- ^ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »
, sendAnimationCaption :: Maybe Text -- ^ Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing
, sendAnimationParseMode :: 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.
, sendAnimationCaptionEntities :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
, sendAnimationCaptionEntities :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the caption, which can be specified instead of @parse_mode@.
, sendAnimationShowCaptionAboveMedia :: Maybe Bool -- ^ Pass 'True', if the caption must be shown above the message media.
, sendAnimationHasSpoiler :: Maybe Bool -- ^ Pass 'True' if the animation needs to be covered with a spoiler animation.
, sendAnimationDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
, sendAnimationProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving.
, sendAnimationMessageEffectId :: Maybe Text -- ^ Unique identifier of the message effect to be added to the message; for private chats only.
, sendAnimationReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.
, sendAnimationReplyParameters :: Maybe ReplyParameters -- ^ Description of the message to reply to.
, sendAnimationReplyMarkup :: 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.
Expand Down
1 change: 1 addition & 0 deletions telegram-bot-api/src/Telegram/Bot/API/Methods/SendAudio.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ data SendAudioRequest = SendAudioRequest
, sendAudioCaptionEntities :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
, sendAudioDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
, sendAudioProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
, sendAudioMessageEffectId :: Maybe Text -- ^ Unique identifier of the message effect to be added to the message; for private chats only.
, sendAudioReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
, sendAudioReplyParameters :: Maybe ReplyParameters -- ^ Description of the message to reply to.
, sendAudioReplyMarkup :: 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.
Expand Down
5 changes: 3 additions & 2 deletions telegram-bot-api/src/Telegram/Bot/API/Methods/SendContact.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ data SendContactRequest = SendContactRequest
, sendContactLastName :: Text -- ^ Contact's last name
, sendContactVcard :: Text -- ^ Additional data about the contact in the form of a vCard, 0-2048 bytes
, sendContactDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
, sendContactProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
, sendContactReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
, sendContactProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving.
, sendContactMessageEffectId :: Maybe Text -- ^ Unique identifier of the message effect to be added to the message; for private chats only.
, sendContactReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.
, sendContactReplyParameters :: Maybe ReplyParameters -- ^ Description of the message to reply to.
, sendContactReplyMarkup :: 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.
}
Expand Down
5 changes: 3 additions & 2 deletions telegram-bot-api/src/Telegram/Bot/API/Methods/SendDice.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ data SendDiceRequest = SendDiceRequest
, sendDiceMessageThreadId :: Maybe MessageThreadId -- ^ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only.
, sendDiceEmoji :: Maybe Text -- ^ Emoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”. Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲”
, sendDiceDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
, sendDiceProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding
, sendDiceReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
, sendDiceProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding.
, sendDiceMessageEffectId :: Maybe Text -- ^ Unique identifier of the message effect to be added to the message; for private chats only.
, sendDiceReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.
, sendDiceReplyParameters :: Maybe ReplyParameters -- ^ Description of the message to reply to.
, sendDiceReplyMarkup :: 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.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ data SendDocumentRequest = SendDocumentRequest
, sendDocumentDisableContentTypeDetection :: Maybe Bool -- ^ Disables automatic server-side content type detection for files uploaded using @multipart/form-data@.
, sendDocumentDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
, sendDocumentProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving.
, sendDocumentMessageEffectId :: Maybe Text -- ^ Unique identifier of the message effect to be added to the message; for private chats only.
, sendDocumentReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.
, sendDocumentReplyParameters :: Maybe ReplyParameters -- ^ Description of the message to reply to.
, sendDocumentReplyMarkup :: 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.
Expand Down
6 changes: 4 additions & 2 deletions telegram-bot-api/src/Telegram/Bot/API/Methods/SendLocation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Telegram.Bot.API.Methods.SendLocation where

import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Proxy
import Data.Text (Text)
import GHC.Generics (Generic)
import Servant.API
import Servant.Client hiding (Response)
Expand All @@ -29,8 +30,9 @@ data SendLocationRequest = SendLocationRequest
, sendLocationHeading :: Maybe Int -- ^ Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
, sendLocationProximityAlertRadius :: Maybe Int -- ^ Maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
, sendLocationDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
, sendLocationProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
, sendLocationReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
, sendLocationProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving.
, sendLocationMessageEffectId :: Maybe Text -- ^ Unique identifier of the message effect to be added to the message; for private chats only.
, sendLocationReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.
, sendLocationReplyParameters :: Maybe ReplyParameters -- ^ Description of the message to reply to.
, sendLocationReplyMarkup :: 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.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Telegram.Bot.API.Methods.SendMediaGroup where

import Data.Aeson (ToJSON (..))
import Data.Proxy
import Data.Text (Text)
import GHC.Generics (Generic)
import Servant.API
import Servant.Client hiding (Response)
Expand All @@ -24,8 +25,9 @@ data SendMediaGroupRequest = SendMediaGroupRequest
, sendMediaGroupMessageThreadId :: Maybe MessageThreadId -- ^ Unique identifier for the target message thread (topic) of the forum; for forum supergroups only.
, sendMediaGroupMedia :: [InputMedia] -- ^ A JSON-serialized array describing messages to be sent, must include 2-10 items. InputMediaAudio, InputMediaDocument, InputMediaPhoto or InputMediaVideo.
, sendMediaGroupDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
, sendMediaGroupProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving
, sendMediaGroupReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message
, sendMediaGroupProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving.
, sendMediaGroupMessageEffectId :: Maybe Text -- ^ Unique identifier of the message effect to be added to the message; for private chats only.
, sendMediaGroupReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.
, sendMediaGroupReplyParameters :: Maybe ReplyParameters -- ^ Description of the message to reply to.
, sendMediaGroupReplyMarkup :: 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.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ data SendMessageRequest = SendMessageRequest
, sendMessageLinkPreviewOptions :: Maybe LinkPreviewOptions -- ^ Link preview generation options for the message.
, sendMessageDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
, sendMessageProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving.
, sendMessageMessageEffectId :: Maybe Text -- ^ Unique identifier of the message effect to be added to the message; for private chats only.
, sendMessageReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.
, sendMessageReplyParameters :: Maybe ReplyParameters -- ^ Description of the message to reply to.
, sendMessageReplyMarkup :: 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.
Expand Down
2 changes: 2 additions & 0 deletions telegram-bot-api/src/Telegram/Bot/API/Methods/SendPhoto.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ data SendPhotoRequest = SendPhotoRequest
, sendPhotoCaption :: Maybe Text -- ^ Photo caption (may also be used when resending Photos by file_id), 0-1024 characters after entities parsing
, sendPhotoParseMode :: 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.
, sendPhotoCaptionEntities :: Maybe [MessageEntity] -- ^ A JSON-serialized list of special entities that appear in the caption, which can be specified instead of /parse_mode/.
, sendPhotoShowCaptionAboveMedia :: Maybe Bool -- ^ Pass 'True', if the caption must be shown above the message media.
, sendPhotoHasSpoiler :: Maybe Bool -- ^ Pass 'True' if the photo needs to be covered with a spoiler animation.
, sendPhotoDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
, sendPhotoProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving.
, sendPhotoMessageEffectId :: Maybe Text -- ^ Unique identifier of the message effect to be added to the message; for private chats only.
, sendPhotoReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.
, sendPhotoReplyParameters :: Maybe ReplyParameters -- ^ Description of the message to reply to.
, sendPhotoReplyMarkup :: 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.
Expand Down
1 change: 1 addition & 0 deletions telegram-bot-api/src/Telegram/Bot/API/Methods/SendPoll.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ data SendPollRequest = SendPollRequest
, sendPollIsClosed :: Maybe Bool -- ^ Pass True, if the poll needs to be immediately closed. This can be useful for poll preview.
, sendPollDisableNotification :: Maybe Bool -- ^ Sends the message silently. Users will receive a notification with no sound.
, sendPollProtectContent :: Maybe Bool -- ^ Protects the contents of the sent message from forwarding and saving.
, sendPollMessageEffectId :: Maybe Text -- ^ Unique identifier of the message effect to be added to the message; for private chats only.
, sendPollReplyToMessageId :: Maybe MessageId -- ^ If the message is a reply, ID of the original message.
, sendPollReplyParameters :: Maybe ReplyParameters -- ^ Description of the message to reply to.
, sendPollReplyMarkup :: 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.
Expand Down
Loading

0 comments on commit 38f9c22

Please sign in to comment.