-
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 July 1, 2024 updates (v7.6)
- Loading branch information
Showing
25 changed files
with
459 additions
and
51 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
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
42 changes: 42 additions & 0 deletions
42
telegramium-core/src/main/scala/telegramium/bots/InputPaidMedia.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,42 @@ | ||
package telegramium.bots | ||
|
||
sealed trait InputPaidMedia {} | ||
|
||
/** The paid media to send is a photo. | ||
* | ||
* @param media | ||
* File to send. 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. | ||
*/ | ||
final case class InputPaidMediaPhoto(media: String) extends InputPaidMedia | ||
|
||
/** The paid media to send is a video. | ||
* | ||
* @param media | ||
* File to send. 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. | ||
* @param thumbnail | ||
* 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>. | ||
* @param width | ||
* Optional. Video width | ||
* @param height | ||
* Optional. Video height | ||
* @param duration | ||
* Optional. Video duration in seconds | ||
* @param supportsStreaming | ||
* Optional. Pass True if the uploaded video is suitable for streaming | ||
*/ | ||
final case class InputPaidMediaVideo( | ||
media: String, | ||
thumbnail: Option[IFile] = Option.empty, | ||
width: Option[Int] = Option.empty, | ||
height: Option[Int] = Option.empty, | ||
duration: Option[Int] = Option.empty, | ||
supportsStreaming: Option[Boolean] = Option.empty | ||
) extends InputPaidMedia |
2 changes: 1 addition & 1 deletion
2
telegramium-core/src/main/scala/telegramium/bots/InputPollOption.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
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
32 changes: 32 additions & 0 deletions
32
telegramium-core/src/main/scala/telegramium/bots/PaidMedia.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,32 @@ | ||
package telegramium.bots | ||
|
||
sealed trait PaidMedia {} | ||
|
||
/** The paid media is a video. | ||
* | ||
* @param video | ||
* The video | ||
*/ | ||
final case class PaidMediaVideo(video: Video) extends PaidMedia | ||
|
||
/** The paid media is a photo. | ||
* | ||
* @param photo | ||
* The photo | ||
*/ | ||
final case class PaidMediaPhoto(photo: List[PhotoSize] = List.empty) extends PaidMedia | ||
|
||
/** The paid media isn't available before the payment. | ||
* | ||
* @param width | ||
* Optional. Media width as defined by the sender | ||
* @param height | ||
* Optional. Media height as defined by the sender | ||
* @param duration | ||
* Optional. Duration of the media in seconds as defined by the sender | ||
*/ | ||
final case class PaidMediaPreview( | ||
width: Option[Int] = Option.empty, | ||
height: Option[Int] = Option.empty, | ||
duration: Option[Int] = Option.empty | ||
) extends PaidMedia |
10 changes: 10 additions & 0 deletions
10
telegramium-core/src/main/scala/telegramium/bots/PaidMediaInfo.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 | ||
|
||
/** Describes the paid media added to a message. | ||
* | ||
* @param starCount | ||
* The number of Telegram Stars that must be paid to buy access to the media | ||
* @param paidMedia | ||
* Information about the paid media | ||
*/ | ||
final case class PaidMediaInfo(starCount: Int, paidMedia: List[iozhik.OpenEnum[PaidMedia]] = List.empty) |
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
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
Oops, something went wrong.