Skip to content

Commit 5f74048

Browse files
committed
Telegram Bot API June 4,2020 updates (v4.9):
New dice emojis, doc updates.
1 parent cd7e3f8 commit 5f74048

28 files changed

+280
-170
lines changed

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-
"1.48.0",
4+
"1.49.0",
55
git.gitCurrentBranch.value,
66
git.gitHeadCommit.value,
77
git.gitDescribedVersion.value,

project/Dependencies.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ object Dependencies {
3131

3232
val logger = Seq(
3333
"org.slf4j" % "slf4j-api" % V.slf4j,
34+
"org.slf4j" % "slf4j-simple" % V.slf4j,
3435
"ch.qos.logback" % "logback-classic" % V.logback,
3536
)
3637

@@ -46,5 +47,5 @@ object Dependencies {
4647

4748
val telegramiumCore: Seq[ModuleID] = common
4849
val telegramiumHigh: Seq[ModuleID] = common
49-
val telegramiumExam: Seq[ModuleID] = common ++ Seq(monix)
50+
val telegramiumExam: Seq[ModuleID] = common ++ logger ++ Seq(monix)
5051
}
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package telegramium.bots
22

3-
/** This object represents a dice with a random value from 1 to 6 for currently
4-
* supported base emoji. (Yes, we're aware of the “proper” singular of die. But
5-
* it's awkward, and we decided to help it change. One dice at a time!)*/
3+
/** This object represents an animated emoji that displays a random value.*/
64
final case class Dice(
75
/** Emoji on which the dice throw animation is based*/
8-
emoji: String,
9-
/** Value of the dice, 1-6 for currently supported base emoji*/
6+
emoji: Emoji,
7+
/** Value of the dice, 1-6 for EmojiDice and EmojiDarts base
8+
* emoji, 1-5 for EmojiBasketball base emoji*/
109
value: Int)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package telegramium.bots
2+
3+
sealed trait Emoji {}
4+
5+
final case object EmojiDice extends Emoji {
6+
override def toString() = "🎲"
7+
}
8+
9+
final case object EmojiDarts extends Emoji {
10+
override def toString() = "🎯"
11+
}
12+
13+
final case object EmojiBasketball extends Emoji {
14+
override def toString() = "🏀"
15+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package telegramium.bots
22

33
final case class HandleUpdateReq(
4-
/** The updates unique identifier. Update identifiers start
4+
/** The update's unique identifier. Update identifiers start
55
* from a certain positive number and increase sequentially.
6-
* This ID becomes especially handy if youre using Webhooks,
6+
* This ID becomes especially handy if you're using Webhooks,
77
* since it allows you to ignore repeated updates or to restore
88
* the correct update sequence, should they get out of order.
99
* If there are no new updates for at least a week, then

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ final case class InlineKeyboardButton(
1717
callbackData: Option[String] = Option.empty,
1818
/** Optional. If set, pressing the button will prompt the user
1919
* to select one of their chats, open that chat and insert the
20-
* bots username and the specified inline query in the input
21-
* field. Can be empty, in which case just the bots username
20+
* bot's username and the specified inline query in the input
21+
* field. Can be empty, in which case just the bot's username
2222
* will be inserted. Note: This offers an easy way for users to
2323
* start using your bot in inline mode when they are currently
2424
* in a private chat with it. Especially useful when combined
2525
* with switch_pm… actions – in this case the user will be
2626
* automatically returned to the chat they switched from,
2727
* skipping the chat selection screen.*/
2828
switchInlineQuery: Option[String] = Option.empty,
29-
/** Optional. If set, pressing the button will insert the bots
29+
/** Optional. If set, pressing the button will insert the bot's
3030
* username and the specified inline query in the current
31-
* chats input field. Can be empty, in which case only the
31+
* chat's input field. Can be empty, in which case only the
3232
* bot's username will be inserted. This offers a quick way for
3333
* the user to open your bot in inline mode in the same chat –
3434
* good for selecting something from multiple options.*/

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ final case class InlineQueryResultGif(
1717
gifHeight: Option[Int] = Option.empty,
1818
/** Optional. Duration of the GIF*/
1919
gifDuration: Option[Int] = Option.empty,
20-
/** URL of the static thumbnail for the result (jpeg or gif)*/
20+
/** URL of the static (JPEG or GIF) or animated (MPEG4)
21+
* thumbnail for the result*/
2122
thumbUrl: String,
23+
/** Optional. MIME type of the thumbnail, must be one of
24+
* “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to
25+
* “image/jpeg”*/
26+
thumbMimeType: Option[String] = Option.empty,
2227
/** Optional. Title for the result*/
2328
title: Option[String] = Option.empty,
2429
/** Optional. Caption of the GIF file to be sent, 0-1024
@@ -257,8 +262,13 @@ final case class InlineQueryResultMpeg4Gif(
257262
mpeg4Height: Option[Int] = Option.empty,
258263
/** Optional. Video duration*/
259264
mpeg4Duration: Option[Int] = Option.empty,
260-
/** URL of the static thumbnail (jpeg or gif) for the result*/
265+
/** URL of the static (JPEG or GIF) or animated (MPEG4)
266+
* thumbnail for the result*/
261267
thumbUrl: String,
268+
/** Optional. MIME type of the thumbnail, must be one of
269+
* “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to
270+
* “image/jpeg”*/
271+
thumbMimeType: Option[String] = Option.empty,
262272
/** Optional. Title for the result*/
263273
title: Option[String] = Option.empty,
264274
/** Optional. Caption of the MPEG-4 file to be sent, 0-1024

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ final case class InputMediaAnimation(
1515
/** Optional. Thumbnail of the file sent; can be ignored if
1616
* thumbnail generation for the file is supported server-side.
1717
* The thumbnail should be in JPEG format and less than 200 kB
18-
* in size. A thumbnails width and height should not exceed
18+
* in size. A thumbnail's width and height should not exceed
1919
* 320. Ignored if the file is not uploaded using
20-
* multipart/form-data. Thumbnails cant be reused and can be
20+
* multipart/form-data. Thumbnails can't be reused and can be
2121
* only uploaded as a new file, so you can pass
2222
* “attach://<file_attach_name>” if the thumbnail was uploaded
2323
* using multipart/form-data under <file_attach_name>. More
@@ -66,9 +66,9 @@ final case class InputMediaVideo(
6666
/** Optional. Thumbnail of the file sent; can be ignored if
6767
* thumbnail generation for the file is supported server-side.
6868
* The thumbnail should be in JPEG format and less than 200 kB
69-
* in size. A thumbnails width and height should not exceed
69+
* in size. A thumbnail's width and height should not exceed
7070
* 320. Ignored if the file is not uploaded using
71-
* multipart/form-data. Thumbnails cant be reused and can be
71+
* multipart/form-data. Thumbnails can't be reused and can be
7272
* only uploaded as a new file, so you can pass
7373
* “attach://<file_attach_name>” if the thumbnail was uploaded
7474
* using multipart/form-data under <file_attach_name>. More
@@ -103,9 +103,9 @@ final case class InputMediaDocument(
103103
/** Optional. Thumbnail of the file sent; can be ignored if
104104
* thumbnail generation for the file is supported server-side.
105105
* The thumbnail should be in JPEG format and less than 200 kB
106-
* in size. A thumbnails width and height should not exceed
106+
* in size. A thumbnail's width and height should not exceed
107107
* 320. Ignored if the file is not uploaded using
108-
* multipart/form-data. Thumbnails cant be reused and can be
108+
* multipart/form-data. Thumbnails can't be reused and can be
109109
* only uploaded as a new file, so you can pass
110110
* “attach://<file_attach_name>” if the thumbnail was uploaded
111111
* using multipart/form-data under <file_attach_name>. More
@@ -131,9 +131,9 @@ final case class InputMediaAudio(
131131
/** Optional. Thumbnail of the file sent; can be ignored if
132132
* thumbnail generation for the file is supported server-side.
133133
* The thumbnail should be in JPEG format and less than 200 kB
134-
* in size. A thumbnails width and height should not exceed
134+
* in size. A thumbnail's width and height should not exceed
135135
* 320. Ignored if the file is not uploaded using
136-
* multipart/form-data. Thumbnails cant be reused and can be
136+
* multipart/form-data. Thumbnails can't be reused and can be
137137
* only uploaded as a new file, so you can pass
138138
* “attach://<file_attach_name>” if the thumbnail was uploaded
139139
* using multipart/form-data under <file_attach_name>. More

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ final case class InlineKeyboardMarkup(
1111
extends KeyboardMarkup
1212

1313
/** Upon receiving a message with this object, Telegram clients will display a
14-
* reply interface to the user (act as if the user has selected the bots message
15-
* and tapped Reply'). This can be extremely useful if you want to create
14+
* reply interface to the user (act as if the user has selected the bot's message
15+
* and tapped 'Reply'). This can be extremely useful if you want to create
1616
* user-friendly step-by-step interfaces without having to sacrifice privacy mode.*/
1717
final case class ForceReply(
1818
/** Shows reply interface to the user, as if they manually
19-
* selected the bots message and tapped Reply'*/
19+
* selected the bot's message and tapped 'Reply'*/
2020
forceReply: Boolean,
2121
/** Optional. Use this parameter if you want to force reply
2222
* from specific users only. Targets: 1) users that are
@@ -72,8 +72,8 @@ final case class ReplyKeyboardMarkup(
7272
* @mentioned in the text of the Message object; 2) if the
7373
* bot's message is a reply (has reply_to_message_id), sender
7474
* of the original message. Example: A user requests to change
75-
* the bots language, bot replies to the request with a
75+
* the bot's language, bot replies to the request with a
7676
* keyboard to select the new language. Other users in the
77-
* group dont see the keyboard.*/
77+
* group don't see the keyboard.*/
7878
selective: Option[Boolean] = Option.empty)
7979
extends KeyboardMarkup

0 commit comments

Comments
 (0)