Skip to content

Commit e6082f4

Browse files
committed
Telegram Bot API June 18, 2024 updates (v7.5)
1 parent 9fb740e commit e6082f4

18 files changed

+377
-47
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# F[Tg] - Telegramium
22

3-
[![Telegram](https://img.shields.io/badge/Telegram%20Bot%20API-7.4%20(May%2028%2C%202024)-blue)](https://core.telegram.org/bots/api#recent-changes)
3+
[![Telegram](https://img.shields.io/badge/Telegram%20Bot%20API-7.5%20(June%2018%2C%202024)-blue)](https://core.telegram.org/bots/api#recent-changes)
44
[![Scala Steward badge](https://img.shields.io/badge/Scala_Steward-helping-blue.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAMAAAARSr4IAAAAVFBMVEUAAACHjojlOy5NWlrKzcYRKjGFjIbp293YycuLa3pYY2LSqql4f3pCUFTgSjNodYRmcXUsPD/NTTbjRS+2jomhgnzNc223cGvZS0HaSD0XLjbaSjElhIr+AAAAAXRSTlMAQObYZgAAAHlJREFUCNdNyosOwyAIhWHAQS1Vt7a77/3fcxxdmv0xwmckutAR1nkm4ggbyEcg/wWmlGLDAA3oL50xi6fk5ffZ3E2E3QfZDCcCN2YtbEWZt+Drc6u6rlqv7Uk0LdKqqr5rk2UCRXOk0vmQKGfc94nOJyQjouF9H/wCc9gECEYfONoAAAAASUVORK5CYII=)](https://scala-steward.org)
55
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.apimorphism/telegramium-core_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.apimorphism/telegramium-core_2.13)
66

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
enablePlugins(GitPlugin)
22

33
ThisBuild / version := Version.mkVersion(
4-
"9.74.0",
4+
"9.75.0",
55
git.gitCurrentBranch.value,
66
git.gitDescribedVersion.value,
77
git.gitUncommittedChanges.value

telegramium-core/src/main/scala/telegramium/bots/InlineKeyboardButton.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ package telegramium.bots
99
* Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to
1010
* mention a user by their identifier without using a username, if this is allowed by their privacy settings.
1111
* @param callbackData
12-
* Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes. Not supported for
13-
* messages sent on behalf of a Telegram Business account.
12+
* Optional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes
1413
* @param webApp
1514
* Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be
1615
* able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package telegramium.bots
2+
3+
sealed trait RevenueWithdrawalState {}
4+
5+
/** The withdrawal is in progress. */
6+
case object RevenueWithdrawalStatePending extends RevenueWithdrawalState
7+
8+
/** The withdrawal succeeded.
9+
*
10+
* @param date
11+
* Date the withdrawal was completed in Unix time
12+
* @param url
13+
* An HTTPS URL that can be used to see transaction details
14+
*/
15+
final case class RevenueWithdrawalStateSucceeded(date: Int, url: String) extends RevenueWithdrawalState
16+
17+
/** The withdrawal failed and the transaction was refunded. */
18+
case object RevenueWithdrawalStateFailed extends RevenueWithdrawalState
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package telegramium.bots
2+
3+
/** Describes a Telegram Star transaction.
4+
*
5+
* @param id
6+
* Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund
7+
* transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from
8+
* users.
9+
* @param amount
10+
* Number of Telegram Stars transferred by the transaction
11+
* @param date
12+
* Date the transaction was created in Unix time
13+
* @param source
14+
* Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a
15+
* failed withdrawal). Only for incoming transactions
16+
* @param receiver
17+
* Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal).
18+
* Only for outgoing transactions
19+
*/
20+
final case class StarTransaction(
21+
id: String,
22+
amount: Int,
23+
date: Int,
24+
source: Option[iozhik.OpenEnum[TransactionPartner]] = Option.empty,
25+
receiver: Option[iozhik.OpenEnum[TransactionPartner]] = Option.empty
26+
)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package telegramium.bots
2+
3+
/** Contains a list of Telegram Star transactions.
4+
*
5+
* @param transactions
6+
* The list of transactions
7+
*/
8+
final case class StarTransactions(transactions: List[StarTransaction] = List.empty)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package telegramium.bots
2+
3+
sealed trait TransactionPartner {}
4+
5+
/** Describes a transaction with an unknown source or recipient. */
6+
case object TransactionPartnerOther extends TransactionPartner
7+
8+
/** Describes a transaction with a user.
9+
*
10+
* @param user
11+
* Information about the user
12+
*/
13+
final case class TransactionPartnerUser(user: User) extends TransactionPartner
14+
15+
/** Describes a withdrawal transaction with Fragment.
16+
*
17+
* @param withdrawalState
18+
* Optional. State of the transaction if the transaction is outgoing
19+
*/
20+
final case class TransactionPartnerFragment(
21+
withdrawalState: Option[iozhik.OpenEnum[RevenueWithdrawalState]] = Option.empty
22+
) extends TransactionPartner

telegramium-core/src/main/scala/telegramium/bots/client/EditMessageCaptionReq.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import telegramium.bots.ParseMode
55
import telegramium.bots.MessageEntity
66
import telegramium.bots.InlineKeyboardMarkup
77

8-
/** @param chatId
8+
/** @param businessConnectionId
9+
* Unique identifier of the business connection on behalf of which the message to be edited was sent
10+
* @param chatId
911
* Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target
1012
* channel (in the format &#064;channelusername)
1113
* @param messageId
@@ -26,6 +28,7 @@ import telegramium.bots.InlineKeyboardMarkup
2628
* A JSON-serialized object for an inline keyboard.
2729
*/
2830
final case class EditMessageCaptionReq(
31+
businessConnectionId: Option[String] = Option.empty,
2932
chatId: Option[ChatId] = Option.empty,
3033
messageId: Option[Int] = Option.empty,
3134
inlineMessageId: Option[String] = Option.empty,

telegramium-core/src/main/scala/telegramium/bots/client/EditMessageLiveLocationReq.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import telegramium.bots.InlineKeyboardMarkup
77
* Latitude of new location
88
* @param longitude
99
* Longitude of new location
10+
* @param businessConnectionId
11+
* Unique identifier of the business connection on behalf of which the message to be edited was sent
1012
* @param chatId
1113
* Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target
1214
* channel (in the format &#064;channelusername)
@@ -32,6 +34,7 @@ import telegramium.bots.InlineKeyboardMarkup
3234
final case class EditMessageLiveLocationReq(
3335
latitude: Float,
3436
longitude: Float,
37+
businessConnectionId: Option[String] = Option.empty,
3538
chatId: Option[ChatId] = Option.empty,
3639
messageId: Option[Int] = Option.empty,
3740
inlineMessageId: Option[String] = Option.empty,

telegramium-core/src/main/scala/telegramium/bots/client/EditMessageMediaReq.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import telegramium.bots.InlineKeyboardMarkup
66

77
/** @param media
88
* A JSON-serialized object for a new media content of the message
9+
* @param businessConnectionId
10+
* Unique identifier of the business connection on behalf of which the message to be edited was sent
911
* @param chatId
1012
* Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target
1113
* channel (in the format &#064;channelusername)
@@ -18,6 +20,7 @@ import telegramium.bots.InlineKeyboardMarkup
1820
*/
1921
final case class EditMessageMediaReq(
2022
media: InputMedia,
23+
businessConnectionId: Option[String] = Option.empty,
2124
chatId: Option[ChatId] = Option.empty,
2225
messageId: Option[Int] = Option.empty,
2326
inlineMessageId: Option[String] = Option.empty,

telegramium-core/src/main/scala/telegramium/bots/client/EditMessageReplyMarkupReq.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ package telegramium.bots.client
33
import telegramium.bots.ChatId
44
import telegramium.bots.InlineKeyboardMarkup
55

6-
/** @param chatId
6+
/** @param businessConnectionId
7+
* Unique identifier of the business connection on behalf of which the message to be edited was sent
8+
* @param chatId
79
* Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target
810
* channel (in the format &#064;channelusername)
911
* @param messageId
@@ -14,6 +16,7 @@ import telegramium.bots.InlineKeyboardMarkup
1416
* A JSON-serialized object for an inline keyboard.
1517
*/
1618
final case class EditMessageReplyMarkupReq(
19+
businessConnectionId: Option[String] = Option.empty,
1720
chatId: Option[ChatId] = Option.empty,
1821
messageId: Option[Int] = Option.empty,
1922
inlineMessageId: Option[String] = Option.empty,

telegramium-core/src/main/scala/telegramium/bots/client/EditMessageTextReq.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import telegramium.bots.InlineKeyboardMarkup
88

99
/** @param text
1010
* New text of the message, 1-4096 characters after entities parsing
11+
* @param businessConnectionId
12+
* Unique identifier of the business connection on behalf of which the message to be edited was sent
1113
* @param chatId
1214
* Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target
1315
* channel (in the format &#064;channelusername)
@@ -27,6 +29,7 @@ import telegramium.bots.InlineKeyboardMarkup
2729
*/
2830
final case class EditMessageTextReq(
2931
text: String,
32+
businessConnectionId: Option[String] = Option.empty,
3033
chatId: Option[ChatId] = Option.empty,
3134
messageId: Option[Int] = Option.empty,
3235
inlineMessageId: Option[String] = Option.empty,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package telegramium.bots.client
2+
3+
/** @param offset
4+
* Number of transactions to skip in the response
5+
* @param limit
6+
* The maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100.
7+
*/
8+
final case class GetStarTransactionsReq(offset: Option[Int] = Option.empty, limit: Option[Int] = Option.empty)

0 commit comments

Comments
 (0)