-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Telegram Bot API December 29, 2023 updates (v7.0)
- Loading branch information
Showing
78 changed files
with
3,158 additions
and
1,404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
telegramium-core/src/main/scala/telegramium/bots/ChatBoost.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package telegramium.bots | ||
|
||
/** This object contains information about a chat boost. | ||
* | ||
* @param boostId | ||
* Unique identifier of the boost | ||
* @param addDate | ||
* Point in time (Unix timestamp) when the chat was boosted | ||
* @param expirationDate | ||
* Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium | ||
* subscription is prolonged | ||
* @param source | ||
* Source of the added boost | ||
*/ | ||
final case class ChatBoost(boostId: String, addDate: Int, expirationDate: Int, source: ChatBoostSource) |
14 changes: 14 additions & 0 deletions
14
telegramium-core/src/main/scala/telegramium/bots/ChatBoostRemoved.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package telegramium.bots | ||
|
||
/** This object represents a boost removed from a chat. | ||
* | ||
* @param chat | ||
* Chat which was boosted | ||
* @param boostId | ||
* Unique identifier of the boost | ||
* @param removeDate | ||
* Point in time (Unix timestamp) when the boost was removed | ||
* @param source | ||
* Source of the removed boost | ||
*/ | ||
final case class ChatBoostRemoved(chat: Chat, boostId: String, removeDate: Int, source: ChatBoostSource) |
43 changes: 43 additions & 0 deletions
43
telegramium-core/src/main/scala/telegramium/bots/ChatBoostSource.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package telegramium.bots | ||
|
||
sealed trait ChatBoostSource {} | ||
|
||
/** The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the | ||
* chat 4 times for the duration of the corresponding Telegram Premium subscription. | ||
* | ||
* @param source | ||
* Source of the boost, always “gift_code” | ||
* @param user | ||
* User for which the gift code was created | ||
*/ | ||
final case class ChatBoostSourceGiftCode(source: String, user: User) extends ChatBoostSource | ||
|
||
/** The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times for the duration | ||
* of the corresponding Telegram Premium subscription. | ||
* | ||
* @param source | ||
* Source of the boost, always “giveaway” | ||
* @param giveawayMessageId | ||
* Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if | ||
* the message isn't sent yet. | ||
* @param user | ||
* Optional. User that won the prize in the giveaway if any | ||
* @param isUnclaimed | ||
* Optional. True, if the giveaway was completed, but there was no user to win the prize | ||
*/ | ||
final case class ChatBoostSourceGiveaway( | ||
source: String, | ||
giveawayMessageId: Int, | ||
user: Option[User] = Option.empty, | ||
isUnclaimed: Option[Boolean] = Option.empty | ||
) extends ChatBoostSource | ||
|
||
/** The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another | ||
* user. | ||
* | ||
* @param source | ||
* Source of the boost, always “premium” | ||
* @param user | ||
* User that boosted the chat | ||
*/ | ||
final case class ChatBoostSourcePremium(source: String, user: User) extends ChatBoostSource |
10 changes: 10 additions & 0 deletions
10
telegramium-core/src/main/scala/telegramium/bots/ChatBoostUpdated.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package telegramium.bots | ||
|
||
/** This object represents a boost added to a chat or changed. | ||
* | ||
* @param chat | ||
* Chat which was boosted | ||
* @param boost | ||
* Infomation about the chat boost | ||
*/ | ||
final case class ChatBoostUpdated(chat: Chat, boost: ChatBoost) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
telegramium-core/src/main/scala/telegramium/bots/ExternalReplyInfo.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package telegramium.bots | ||
|
||
/** This object contains information about a message that is being replied to, which may come from another chat or forum | ||
* topic. | ||
* | ||
* @param origin | ||
* Origin of the message replied to by the given message | ||
* @param chat | ||
* Optional. Chat the original message belongs to. Available only if the chat is a supergroup or a channel. | ||
* @param messageId | ||
* Optional. Unique message identifier inside the original chat. Available only if the original chat is a supergroup | ||
* or a channel. | ||
* @param linkPreviewOptions | ||
* Optional. Options used for link preview generation for the original message, if it is a text message | ||
* @param animation | ||
* Optional. Message is an animation, information about the animation | ||
* @param audio | ||
* Optional. Message is an audio file, information about the file | ||
* @param document | ||
* Optional. Message is a general file, information about the file | ||
* @param photo | ||
* Optional. Message is a photo, available sizes of the photo | ||
* @param sticker | ||
* Optional. Message is a sticker, information about the sticker | ||
* @param story | ||
* Optional. Message is a forwarded story | ||
* @param video | ||
* Optional. Message is a video, information about the video | ||
* @param videoNote | ||
* Optional. Message is a video note, information about the video message | ||
* @param voice | ||
* Optional. Message is a voice message, information about the file | ||
* @param hasMediaSpoiler | ||
* Optional. True, if the message media is covered by a spoiler animation | ||
* @param contact | ||
* Optional. Message is a shared contact, information about the contact | ||
* @param dice | ||
* Optional. Message is a dice with random value | ||
* @param game | ||
* Optional. Message is a game, information about the game. | ||
* @param giveaway | ||
* Optional. Message is a scheduled giveaway, information about the giveaway | ||
* @param giveawayWinners | ||
* Optional. A giveaway with public winners was completed | ||
* @param invoice | ||
* Optional. Message is an invoice for a payment, information about the invoice. | ||
* @param location | ||
* Optional. Message is a shared location, information about the location | ||
* @param poll | ||
* Optional. Message is a native poll, information about the poll | ||
* @param venue | ||
* Optional. Message is a venue, information about the venue | ||
*/ | ||
final case class ExternalReplyInfo( | ||
origin: MessageOrigin, | ||
chat: Option[Chat] = Option.empty, | ||
messageId: Option[Int] = Option.empty, | ||
linkPreviewOptions: Option[LinkPreviewOptions] = Option.empty, | ||
animation: Option[Animation] = Option.empty, | ||
audio: Option[Audio] = Option.empty, | ||
document: Option[Document] = Option.empty, | ||
photo: List[PhotoSize] = List.empty, | ||
sticker: Option[Sticker] = Option.empty, | ||
story: Option[Story.type] = Option.empty, | ||
video: Option[Video] = Option.empty, | ||
videoNote: Option[VideoNote] = Option.empty, | ||
voice: Option[Voice] = Option.empty, | ||
hasMediaSpoiler: Option[Boolean] = Option.empty, | ||
contact: Option[Contact] = Option.empty, | ||
dice: Option[Dice] = Option.empty, | ||
game: Option[Game] = Option.empty, | ||
giveaway: Option[Giveaway] = Option.empty, | ||
giveawayWinners: Option[GiveawayWinners] = Option.empty, | ||
invoice: Option[Invoice] = Option.empty, | ||
location: Option[Location] = Option.empty, | ||
poll: Option[Poll] = Option.empty, | ||
venue: Option[Venue] = Option.empty | ||
) |
33 changes: 33 additions & 0 deletions
33
telegramium-core/src/main/scala/telegramium/bots/Giveaway.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package telegramium.bots | ||
|
||
/** This object represents a message about a scheduled giveaway. | ||
* | ||
* @param winnersSelectionDate | ||
* Point in time (Unix timestamp) when winners of the giveaway will be selected | ||
* @param winnerCount | ||
* The number of users which are supposed to be selected as winners of the giveaway | ||
* @param chats | ||
* The list of chats which the user must join to participate in the giveaway | ||
* @param onlyNewMembers | ||
* Optional. True, if only users who join the chats after the giveaway started should be eligible to win | ||
* @param hasPublicWinners | ||
* Optional. True, if the list of giveaway winners will be visible to everyone | ||
* @param prizeDescription | ||
* Optional. Description of additional giveaway prize | ||
* @param countryCodes | ||
* Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users | ||
* for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number | ||
* that was bought on Fragment can always participate in giveaways. | ||
* @param premiumSubscriptionMonthCount | ||
* Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for | ||
*/ | ||
final case class Giveaway( | ||
winnersSelectionDate: Int, | ||
winnerCount: Int, | ||
chats: List[Chat] = List.empty, | ||
onlyNewMembers: Option[Boolean] = Option.empty, | ||
hasPublicWinners: Option[Boolean] = Option.empty, | ||
prizeDescription: Option[String] = Option.empty, | ||
countryCodes: List[String] = List.empty, | ||
premiumSubscriptionMonthCount: Option[Int] = Option.empty | ||
) |
Oops, something went wrong.