Skip to content

Commit b4a14b3

Browse files
committed
Telegram Bot API April 11, 2025 updates (v9.0)
1 parent 6bbebe6 commit b4a14b3

File tree

60 files changed

+2169
-1536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2169
-1536
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-8.3%20(February%2012%2C%202025)-blue)](https://core.telegram.org/bots/api#recent-changes)
3+
[![Telegram](https://img.shields.io/badge/Telegram%20Bot%20API-9.0%20(April%2011%2C%202025)-blue)](https://core.telegram.org/bots/api#recent-changes)
44
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.apimorphism/telegramium-core_3/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.apimorphism/telegramium-core_3)
55

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.803.0",
4+
"9.900.0",
55
git.gitCurrentBranch.value,
66
git.gitDescribedVersion.value,
77
git.gitUncommittedChanges.value
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package telegramium.bots
2+
3+
/** This object describes the types of gifts that can be gifted to a user or a chat.
4+
*
5+
* @param unlimitedGifts
6+
* True, if unlimited regular gifts are accepted
7+
* @param limitedGifts
8+
* True, if limited regular gifts are accepted
9+
* @param uniqueGifts
10+
* True, if unique gifts or gifts that can be upgraded to unique for free are accepted
11+
* @param premiumSubscription
12+
* True, if a Telegram Premium subscription is accepted
13+
*/
14+
final case class AcceptedGiftTypes(
15+
unlimitedGifts: Boolean,
16+
limitedGifts: Boolean,
17+
uniqueGifts: Boolean,
18+
premiumSubscription: Boolean
19+
)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package telegramium.bots
2+
3+
/** Represents the rights of a business bot.
4+
*
5+
* @param canReply
6+
* Optional. True, if the bot can send and edit messages in the private chats that had incoming messages in the last
7+
* 24 hours
8+
* @param canReadMessages
9+
* Optional. True, if the bot can mark incoming private messages as read
10+
* @param canDeleteSentMessages
11+
* Optional. True, if the bot can delete messages sent by the bot
12+
* @param canDeleteAllMessages
13+
* Optional. True, if the bot can delete all private messages in managed chats
14+
* @param canEditName
15+
* Optional. True, if the bot can edit the first and last name of the business account
16+
* @param canEditBio
17+
* Optional. True, if the bot can edit the bio of the business account
18+
* @param canEditProfilePhoto
19+
* Optional. True, if the bot can edit the profile photo of the business account
20+
* @param canEditUsername
21+
* Optional. True, if the bot can edit the username of the business account
22+
* @param canChangeGiftSettings
23+
* Optional. True, if the bot can change the privacy settings pertaining to gifts for the business account
24+
* @param canViewGiftsAndStars
25+
* Optional. True, if the bot can view gifts and the amount of Telegram Stars owned by the business account
26+
* @param canConvertGiftsToStars
27+
* Optional. True, if the bot can convert regular gifts owned by the business account to Telegram Stars
28+
* @param canTransferAndUpgradeGifts
29+
* Optional. True, if the bot can transfer and upgrade gifts owned by the business account
30+
* @param canTransferStars
31+
* Optional. True, if the bot can transfer Telegram Stars received by the business account to its own account, or use
32+
* them to upgrade and transfer gifts
33+
* @param canManageStories
34+
* Optional. True, if the bot can post, edit and delete stories on behalf of the business account
35+
*/
36+
final case class BusinessBotRights(
37+
canReply: Option[Boolean] = Option.empty,
38+
canReadMessages: Option[Boolean] = Option.empty,
39+
canDeleteSentMessages: Option[Boolean] = Option.empty,
40+
canDeleteAllMessages: Option[Boolean] = Option.empty,
41+
canEditName: Option[Boolean] = Option.empty,
42+
canEditBio: Option[Boolean] = Option.empty,
43+
canEditProfilePhoto: Option[Boolean] = Option.empty,
44+
canEditUsername: Option[Boolean] = Option.empty,
45+
canChangeGiftSettings: Option[Boolean] = Option.empty,
46+
canViewGiftsAndStars: Option[Boolean] = Option.empty,
47+
canConvertGiftsToStars: Option[Boolean] = Option.empty,
48+
canTransferAndUpgradeGifts: Option[Boolean] = Option.empty,
49+
canTransferStars: Option[Boolean] = Option.empty,
50+
canManageStories: Option[Boolean] = Option.empty
51+
)

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ package telegramium.bots
1313
* identifier.
1414
* @param date
1515
* Date the connection was established in Unix time
16-
* @param canReply
17-
* True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours
1816
* @param isEnabled
1917
* True, if the connection is active
18+
* @param rights
19+
* Optional. Rights of the business bot
2020
*/
2121
final case class BusinessConnection(
2222
id: String,
2323
user: User,
2424
userChatId: Long,
2525
date: Int,
26-
canReply: Boolean,
27-
isEnabled: Boolean
26+
isEnabled: Boolean,
27+
rights: Option[BusinessBotRights] = Option.empty
2828
)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ package telegramium.bots
1313
* preview. See accent colors for more details.
1414
* @param maxReactionCount
1515
* The maximum number of reactions that can be set on a message in the chat
16+
* @param acceptedGiftTypes
17+
* Information about types of gifts that are accepted by the chat or by the corresponding user for private chats
1618
* @param title
1719
* Optional. Title, for supergroups, channels and group chats
1820
* @param username
@@ -72,8 +74,6 @@ package telegramium.bots
7274
* Optional. The most recent pinned message (by sending date)
7375
* @param permissions
7476
* Optional. Default chat member permissions, for groups and supergroups
75-
* @param canSendGift
76-
* Optional. True, if gifts can be sent to the chat
7777
* @param canSendPaidMedia
7878
* Optional. True, if paid media messages can be sent or forwarded to the channel chat. The field is available only
7979
* for channel chats.
@@ -114,6 +114,7 @@ final case class ChatFullInfo(
114114
`type`: String,
115115
accentColorId: Int,
116116
maxReactionCount: Int,
117+
acceptedGiftTypes: AcceptedGiftTypes,
117118
title: Option[String] = Option.empty,
118119
username: Option[String] = Option.empty,
119120
firstName: Option[String] = Option.empty,
@@ -141,7 +142,6 @@ final case class ChatFullInfo(
141142
inviteLink: Option[String] = Option.empty,
142143
pinnedMessage: Option[Message] = Option.empty,
143144
permissions: Option[ChatPermissions] = Option.empty,
144-
canSendGift: Option[Boolean] = Option.empty,
145145
canSendPaidMedia: Option[Boolean] = Option.empty,
146146
slowModeDelay: Option[Int] = Option.empty,
147147
unrestrictBoostCount: Option[Int] = Option.empty,

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ sealed trait ChatMember {}
1414
final case class ChatMemberOwner(user: User, isAnonymous: Boolean, customTitle: Option[String] = Option.empty)
1515
extends ChatMember
1616

17+
/** Represents a chat member that isn't currently a member of the chat, but may join it themselves.
18+
*
19+
* @param user
20+
* Information about the user
21+
*/
22+
final case class ChatMemberLeft(user: User) extends ChatMember
23+
1724
/** Represents a chat member that has some additional privileges.
1825
*
1926
* @param user
@@ -79,13 +86,6 @@ final case class ChatMemberAdministrator(
7986
customTitle: Option[String] = Option.empty
8087
) extends ChatMember
8188

82-
/** Represents a chat member that isn't currently a member of the chat, but may join it themselves.
83-
*
84-
* @param user
85-
* Information about the user
86-
*/
87-
final case class ChatMemberLeft(user: User) extends ChatMember
88-
8989
/** Represents a chat member that has no additional privileges or restrictions.
9090
*
9191
* @param user
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package telegramium.bots
2+
3+
/** Describes a service message about a regular gift that was sent or received.
4+
*
5+
* @param gift
6+
* Information about the gift
7+
* @param ownedGiftId
8+
* Optional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of
9+
* business accounts
10+
* @param convertStarCount
11+
* Optional. Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if
12+
* conversion to Telegram Stars is impossible
13+
* @param prepaidUpgradeStarCount
14+
* Optional. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift
15+
* @param canBeUpgraded
16+
* Optional. True, if the gift can be upgraded to a unique gift
17+
* @param text
18+
* Optional. Text of the message that was added to the gift
19+
* @param entities
20+
* Optional. Special entities that appear in the text
21+
* @param isPrivate
22+
* Optional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able
23+
* to see them
24+
*/
25+
final case class GiftInfo(
26+
gift: Gift,
27+
ownedGiftId: Option[String] = Option.empty,
28+
convertStarCount: Option[Int] = Option.empty,
29+
prepaidUpgradeStarCount: Option[Int] = Option.empty,
30+
canBeUpgraded: Option[Boolean] = Option.empty,
31+
text: Option[String] = Option.empty,
32+
entities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
33+
isPrivate: Option[Boolean] = Option.empty
34+
)

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ final case class InlineQueryResultGif(
4747
title: Option[String] = Option.empty,
4848
caption: Option[String] = Option.empty,
4949
parseMode: Option[ParseMode] = Option.empty,
50-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
50+
captionEntities: List[MessageEntity] = List.empty,
5151
showCaptionAboveMedia: Option[Boolean] = Option.empty,
5252
replyMarkup: Option[InlineKeyboardMarkup] = Option.empty,
5353
inputMessageContent: Option[InputMessageContent] = Option.empty
@@ -180,7 +180,7 @@ final case class InlineQueryResultPhoto(
180180
description: Option[String] = Option.empty,
181181
caption: Option[String] = Option.empty,
182182
parseMode: Option[ParseMode] = Option.empty,
183-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
183+
captionEntities: List[MessageEntity] = List.empty,
184184
showCaptionAboveMedia: Option[Boolean] = Option.empty,
185185
replyMarkup: Option[InlineKeyboardMarkup] = Option.empty,
186186
inputMessageContent: Option[InputMessageContent] = Option.empty
@@ -224,7 +224,7 @@ final case class InlineQueryResultDocument(
224224
mimeType: String,
225225
caption: Option[String] = Option.empty,
226226
parseMode: Option[ParseMode] = Option.empty,
227-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
227+
captionEntities: List[MessageEntity] = List.empty,
228228
description: Option[String] = Option.empty,
229229
replyMarkup: Option[InlineKeyboardMarkup] = Option.empty,
230230
inputMessageContent: Option[InputMessageContent] = Option.empty,
@@ -260,7 +260,7 @@ final case class InlineQueryResultCachedVoice(
260260
title: String,
261261
caption: Option[String] = Option.empty,
262262
parseMode: Option[ParseMode] = Option.empty,
263-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
263+
captionEntities: List[MessageEntity] = List.empty,
264264
replyMarkup: Option[InlineKeyboardMarkup] = Option.empty,
265265
inputMessageContent: Option[InputMessageContent] = Option.empty
266266
) extends InlineQueryResult
@@ -328,7 +328,7 @@ final case class InlineQueryResultAudio(
328328
title: String,
329329
caption: Option[String] = Option.empty,
330330
parseMode: Option[ParseMode] = Option.empty,
331-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
331+
captionEntities: List[MessageEntity] = List.empty,
332332
performer: Option[String] = Option.empty,
333333
audioDuration: Option[Int] = Option.empty,
334334
replyMarkup: Option[InlineKeyboardMarkup] = Option.empty,
@@ -380,7 +380,7 @@ final case class InlineQueryResultMpeg4Gif(
380380
title: Option[String] = Option.empty,
381381
caption: Option[String] = Option.empty,
382382
parseMode: Option[ParseMode] = Option.empty,
383-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
383+
captionEntities: List[MessageEntity] = List.empty,
384384
showCaptionAboveMedia: Option[Boolean] = Option.empty,
385385
replyMarkup: Option[InlineKeyboardMarkup] = Option.empty,
386386
inputMessageContent: Option[InputMessageContent] = Option.empty
@@ -415,7 +415,7 @@ final case class InlineQueryResultCachedMpeg4Gif(
415415
title: Option[String] = Option.empty,
416416
caption: Option[String] = Option.empty,
417417
parseMode: Option[ParseMode] = Option.empty,
418-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
418+
captionEntities: List[MessageEntity] = List.empty,
419419
showCaptionAboveMedia: Option[Boolean] = Option.empty,
420420
replyMarkup: Option[InlineKeyboardMarkup] = Option.empty,
421421
inputMessageContent: Option[InputMessageContent] = Option.empty
@@ -451,7 +451,7 @@ final case class InlineQueryResultCachedDocument(
451451
description: Option[String] = Option.empty,
452452
caption: Option[String] = Option.empty,
453453
parseMode: Option[ParseMode] = Option.empty,
454-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
454+
captionEntities: List[MessageEntity] = List.empty,
455455
replyMarkup: Option[InlineKeyboardMarkup] = Option.empty,
456456
inputMessageContent: Option[InputMessageContent] = Option.empty
457457
) extends InlineQueryResult
@@ -488,7 +488,7 @@ final case class InlineQueryResultCachedVideo(
488488
description: Option[String] = Option.empty,
489489
caption: Option[String] = Option.empty,
490490
parseMode: Option[ParseMode] = Option.empty,
491-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
491+
captionEntities: List[MessageEntity] = List.empty,
492492
showCaptionAboveMedia: Option[Boolean] = Option.empty,
493493
replyMarkup: Option[InlineKeyboardMarkup] = Option.empty,
494494
inputMessageContent: Option[InputMessageContent] = Option.empty
@@ -541,7 +541,7 @@ final case class InlineQueryResultCachedPhoto(
541541
description: Option[String] = Option.empty,
542542
caption: Option[String] = Option.empty,
543543
parseMode: Option[ParseMode] = Option.empty,
544-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
544+
captionEntities: List[MessageEntity] = List.empty,
545545
showCaptionAboveMedia: Option[Boolean] = Option.empty,
546546
replyMarkup: Option[InlineKeyboardMarkup] = Option.empty,
547547
inputMessageContent: Option[InputMessageContent] = Option.empty
@@ -611,7 +611,7 @@ final case class InlineQueryResultVideo(
611611
title: String,
612612
caption: Option[String] = Option.empty,
613613
parseMode: Option[ParseMode] = Option.empty,
614-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
614+
captionEntities: List[MessageEntity] = List.empty,
615615
showCaptionAboveMedia: Option[Boolean] = Option.empty,
616616
videoWidth: Option[Int] = Option.empty,
617617
videoHeight: Option[Int] = Option.empty,
@@ -645,7 +645,7 @@ final case class InlineQueryResultCachedAudio(
645645
audioFileId: String,
646646
caption: Option[String] = Option.empty,
647647
parseMode: Option[ParseMode] = Option.empty,
648-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
648+
captionEntities: List[MessageEntity] = List.empty,
649649
replyMarkup: Option[InlineKeyboardMarkup] = Option.empty,
650650
inputMessageContent: Option[InputMessageContent] = Option.empty
651651
) extends InlineQueryResult
@@ -728,7 +728,7 @@ final case class InlineQueryResultCachedGif(
728728
title: Option[String] = Option.empty,
729729
caption: Option[String] = Option.empty,
730730
parseMode: Option[ParseMode] = Option.empty,
731-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
731+
captionEntities: List[MessageEntity] = List.empty,
732732
showCaptionAboveMedia: Option[Boolean] = Option.empty,
733733
replyMarkup: Option[InlineKeyboardMarkup] = Option.empty,
734734
inputMessageContent: Option[InputMessageContent] = Option.empty
@@ -763,7 +763,7 @@ final case class InlineQueryResultVoice(
763763
title: String,
764764
caption: Option[String] = Option.empty,
765765
parseMode: Option[ParseMode] = Option.empty,
766-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
766+
captionEntities: List[MessageEntity] = List.empty,
767767
voiceDuration: Option[Int] = Option.empty,
768768
replyMarkup: Option[InlineKeyboardMarkup] = Option.empty,
769769
inputMessageContent: Option[InputMessageContent] = Option.empty

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ final case class InputMediaAnimation(
3636
thumbnail: Option[IFile] = Option.empty,
3737
caption: Option[String] = Option.empty,
3838
parseMode: Option[ParseMode] = Option.empty,
39-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
39+
captionEntities: List[MessageEntity] = List.empty,
4040
showCaptionAboveMedia: Option[Boolean] = Option.empty,
4141
width: Option[Int] = Option.empty,
4242
height: Option[Int] = Option.empty,
@@ -65,7 +65,7 @@ final case class InputMediaPhoto(
6565
media: IFile,
6666
caption: Option[String] = Option.empty,
6767
parseMode: Option[ParseMode] = Option.empty,
68-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
68+
captionEntities: List[MessageEntity] = List.empty,
6969
showCaptionAboveMedia: Option[Boolean] = Option.empty,
7070
hasSpoiler: Option[Boolean] = Option.empty
7171
) extends InputMedia
@@ -114,7 +114,7 @@ final case class InputMediaVideo(
114114
startTimestamp: Option[Int] = Option.empty,
115115
caption: Option[String] = Option.empty,
116116
parseMode: Option[ParseMode] = Option.empty,
117-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
117+
captionEntities: List[MessageEntity] = List.empty,
118118
showCaptionAboveMedia: Option[Boolean] = Option.empty,
119119
width: Option[Int] = Option.empty,
120120
height: Option[Int] = Option.empty,
@@ -150,7 +150,7 @@ final case class InputMediaDocument(
150150
thumbnail: Option[IFile] = Option.empty,
151151
caption: Option[String] = Option.empty,
152152
parseMode: Option[ParseMode] = Option.empty,
153-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
153+
captionEntities: List[MessageEntity] = List.empty,
154154
disableContentTypeDetection: Option[Boolean] = Option.empty
155155
) extends InputMedia
156156

@@ -184,7 +184,7 @@ final case class InputMediaAudio(
184184
thumbnail: Option[IFile] = Option.empty,
185185
caption: Option[String] = Option.empty,
186186
parseMode: Option[ParseMode] = Option.empty,
187-
captionEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
187+
captionEntities: List[MessageEntity] = List.empty,
188188
duration: Option[Int] = Option.empty,
189189
performer: Option[String] = Option.empty,
190190
title: Option[String] = Option.empty

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,6 @@ final case class InputLocationMessageContent(
174174
final case class InputTextMessageContent(
175175
messageText: String,
176176
parseMode: Option[ParseMode] = Option.empty,
177-
entities: List[iozhik.OpenEnum[MessageEntity]] = List.empty,
177+
entities: List[MessageEntity] = List.empty,
178178
linkPreviewOptions: Option[LinkPreviewOptions] = Option.empty
179179
) extends InputMessageContent

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ package telegramium.bots
1414
final case class InputPollOption(
1515
text: String,
1616
textParseMode: Option[ParseMode] = Option.empty,
17-
textEntities: List[iozhik.OpenEnum[MessageEntity]] = List.empty
17+
textEntities: List[MessageEntity] = List.empty
1818
)

0 commit comments

Comments
 (0)