Skip to content

Commit

Permalink
7.9.0 (#344)
Browse files Browse the repository at this point in the history
* Supported Telegram API [8.3](https://core.telegram.org/bots/api-changelog#february-12-2025).
* Added `isAccessible` and `accessibleOrNull()` to `MaybeInaccessibleMessage` to make easier handling.
* Added `handleLoggingProvider` parameter to plugin, to give option to disable handling of logging provider.
* Added warnings when helper annotations used for inappropriate handlers.
  • Loading branch information
vendelieu authored Feb 13, 2025
1 parent a9d9f48 commit 48a7442
Show file tree
Hide file tree
Showing 80 changed files with 1,135 additions and 935 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Telegram chat
url: https://t.me/vennyTgBot
url: https://t.me/venny_tgbot
about: Please feel free to ask and answer usage-related questions here.
1 change: 1 addition & 0 deletions .github/workflows/ci.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
BOT_TOKEN_2: ${{ secrets.BOT_TOKEN_2 }}
CHANNEL_ID: ${{ secrets.CHANNEL_ID }}
PAYMENT_PROVIDER_TOKEN: ${{ secrets.PAYMENT_PROVIDER_TOKEN }}
run: ./gradlew koverXmlReport

- name: Upload coverage to Codecov
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Telegram-bot (KtGram) Changelog

## 7.9.0

* Supported Telegram API [8.3](https://core.telegram.org/bots/api-changelog#february-12-2025).
* Added `isAccessible` and `accessibleOrNull()` to `MaybeInaccessibleMessage` to make easier handling.
* Added `handleLoggingProvider` parameter to plugin, to give option to disable handling of logging provider.
* Added warnings when helper annotations used for inappropriate handlers.

## 7.8.0

* Supported Telegram API [8.2](https://core.telegram.org/bots/api-changelog#january-1-2025).
Expand Down
165 changes: 148 additions & 17 deletions buildSrc/src/main/resources/api.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "Bot API 8.2",
"release_date": "January 1, 2025",
"changelog": "https://core.telegram.org/bots/api#january-1-2025",
"version": "Bot API 8.3",
"release_date": "February 12, 2025",
"changelog": "https://core.telegram.org/bots/api#february-12-2025",
"methods": {
"getUpdates": {
"name": "getUpdates",
Expand Down Expand Up @@ -332,6 +332,14 @@
"required": true,
"description": "Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)"
},
{
"name": "video_start_timestamp",
"types": [
"Integer"
],
"required": false,
"description": "New start timestamp for the forwarded video in the message"
},
{
"name": "disable_notification",
"types": [
Expand Down Expand Up @@ -464,6 +472,14 @@
"required": true,
"description": "Message identifier in the chat specified in from_chat_id"
},
{
"name": "video_start_timestamp",
"types": [
"Integer"
],
"required": false,
"description": "New start timestamp for the copied video in the message"
},
{
"name": "caption",
"types": [
Expand Down Expand Up @@ -1118,6 +1134,23 @@
"required": false,
"description": "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 information on Sending Files: https://core.telegram.org/bots/api#sending-files"
},
{
"name": "cover",
"types": [
"InputFile",
"String"
],
"required": false,
"description": "Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"
},
{
"name": "start_timestamp",
"types": [
"Integer"
],
"required": false,
"description": "Start timestamp for the video in the message"
},
{
"name": "caption",
"types": [
Expand Down Expand Up @@ -2610,7 +2643,7 @@
"name": "setMessageReaction",
"href": "https://core.telegram.org/bots/api#setmessagereaction",
"description": [
"Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success."
"Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success."
],
"returns": [
"Boolean"
Expand Down Expand Up @@ -5755,7 +5788,7 @@
"name": "getAvailableGifts",
"href": "https://core.telegram.org/bots/api#getavailablegifts",
"description": [
"Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a Gifts object."
"Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object."
],
"returns": [
"Gifts"
Expand All @@ -5765,7 +5798,7 @@
"name": "sendGift",
"href": "https://core.telegram.org/bots/api#sendgift",
"description": [
"Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns True on success."
"Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success."
],
"returns": [
"Boolean"
Expand All @@ -5776,8 +5809,17 @@
"types": [
"Integer"
],
"required": true,
"description": "Unique identifier of the target user that will receive the gift"
"required": false,
"description": "Required if chat_id is not specified. Unique identifier of the target user who will receive the gift."
},
{
"name": "chat_id",
"types": [
"Integer",
"String"
],
"required": false,
"description": "Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift."
},
{
"name": "gift_id",
Expand All @@ -5801,7 +5843,7 @@
"String"
],
"required": false,
"description": "Text that will be shown along with the gift; 0-255 characters"
"description": "Text that will be shown along with the gift; 0-128 characters"
},
{
"name": "text_parse_mode",
Expand Down Expand Up @@ -6541,7 +6583,7 @@
"String"
],
"required": false,
"description": "Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. \"Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user."
"description": "Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. \"Sorry, delivery to your desired address is unavailable\"). Telegram will display this message to the user."
}
]
},
Expand Down Expand Up @@ -7625,6 +7667,14 @@
"required": false,
"description": "Optional. Default chat member permissions, for groups and supergroups"
},
{
"name": "can_send_gift",
"types": [
"Boolean"
],
"required": false,
"description": "Optional. True, if gifts can be sent to the chat"
},
{
"name": "can_send_paid_media",
"types": [
Expand Down Expand Up @@ -9395,6 +9445,22 @@
"required": false,
"description": "Optional. Video thumbnail"
},
{
"name": "cover",
"types": [
"Array of PhotoSize"
],
"required": false,
"description": "Optional. Available sizes of the cover of the video in the message"
},
{
"name": "start_timestamp",
"types": [
"Integer"
],
"required": false,
"description": "Optional. Timestamp in seconds from which the video will play in the message"
},
{
"name": "file_name",
"types": [
Expand Down Expand Up @@ -14104,12 +14170,27 @@
{
"name": "thumbnail",
"types": [
"InputFile",
"String"
],
"required": false,
"description": "Optional. 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 information on Sending Files: https://core.telegram.org/bots/api#sending-files"
},
{
"name": "cover",
"types": [
"String"
],
"required": false,
"description": "Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"
},
{
"name": "start_timestamp",
"types": [
"Integer"
],
"required": false,
"description": "Optional. Start timestamp for the video in the message"
},
{
"name": "caption",
"types": [
Expand Down Expand Up @@ -14213,7 +14294,6 @@
{
"name": "thumbnail",
"types": [
"InputFile",
"String"
],
"required": false,
Expand Down Expand Up @@ -14314,7 +14394,6 @@
{
"name": "thumbnail",
"types": [
"InputFile",
"String"
],
"required": false,
Expand Down Expand Up @@ -14399,7 +14478,6 @@
{
"name": "thumbnail",
"types": [
"InputFile",
"String"
],
"required": false,
Expand Down Expand Up @@ -14516,12 +14594,27 @@
{
"name": "thumbnail",
"types": [
"InputFile",
"String"
],
"required": false,
"description": "Optional. 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 information on Sending Files: https://core.telegram.org/bots/api#sending-files"
},
{
"name": "cover",
"types": [
"String"
],
"required": false,
"description": "Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"
},
{
"name": "start_timestamp",
"types": [
"Integer"
],
"required": false,
"description": "Optional. Start timestamp for the video in the message"
},
{
"name": "width",
"types": [
Expand Down Expand Up @@ -17782,7 +17875,7 @@
"name": "SuccessfulPayment",
"href": "https://core.telegram.org/bots/api#successfulpayment",
"description": [
"This object contains basic information about a successful payment."
"This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control."
],
"fields": [
{
Expand Down Expand Up @@ -18193,6 +18286,7 @@
"description": [
"This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of",
"- TransactionPartnerUser",
"- TransactionPartnerChat",
"- TransactionPartnerAffiliateProgram",
"- TransactionPartnerFragment",
"- TransactionPartnerTelegramAds",
Expand All @@ -18201,6 +18295,7 @@
],
"subtypes": [
"TransactionPartnerUser",
"TransactionPartnerChat",
"TransactionPartnerAffiliateProgram",
"TransactionPartnerFragment",
"TransactionPartnerTelegramAds",
Expand Down Expand Up @@ -18284,6 +18379,42 @@
"TransactionPartner"
]
},
"TransactionPartnerChat": {
"name": "TransactionPartnerChat",
"href": "https://core.telegram.org/bots/api#transactionpartnerchat",
"description": [
"Describes a transaction with a chat."
],
"fields": [
{
"name": "type",
"types": [
"String"
],
"required": true,
"description": "Type of the transaction partner, always \"chat\""
},
{
"name": "chat",
"types": [
"Chat"
],
"required": true,
"description": "Information about the chat"
},
{
"name": "gift",
"types": [
"Gift"
],
"required": false,
"description": "Optional. The gift sent to the chat by the bot"
}
],
"subtype_of": [
"TransactionPartner"
]
},
"TransactionPartnerAffiliateProgram": {
"name": "TransactionPartnerAffiliateProgram",
"href": "https://core.telegram.org/bots/api#transactionpartneraffiliateprogram",
Expand Down Expand Up @@ -18420,7 +18551,7 @@
"name": "StarTransaction",
"href": "https://core.telegram.org/bots/api#startransaction",
"description": [
"Describes a Telegram Star transaction."
"Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control."
],
"fields": [
{
Expand Down
Loading

0 comments on commit 48a7442

Please sign in to comment.