Skip to content

Commit

Permalink
Telegram Bot API December 30, 2021 updates (v5.6)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnspade committed Jan 10, 2022
1 parent 8bce575 commit 4f3eb53
Show file tree
Hide file tree
Showing 28 changed files with 266 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# F[Tg] - Telegramium

[![Telegram](https://img.shields.io/badge/Telegram%20Bot%20API-5.5%20(December%207%2C%202021)-blue)](https://core.telegram.org/bots/api#recent-changes)
[![Telegram](https://img.shields.io/badge/Telegram%20Bot%20API-5.6%20(December%2030%2C%202021)-blue)](https://core.telegram.org/bots/api#recent-changes)
[![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)
[![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)

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
enablePlugins(GitPlugin)

ThisBuild / version := Version.mkVersion(
"7.55.0",
"7.56.0",
git.gitCurrentBranch.value,
git.gitDescribedVersion.value,
git.gitUncommittedChanges.value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package telegramium.bots
/** This object represents a bot command.
*
* @param command
* Text of the command, 1-32 characters. Can contain only lowercase English letters, digits and underscores.
* Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
* @param description
* Description of the command, 3-256 characters.
* Description of the command; 1-256 characters.
*/
final case class BotCommand(command: String, description: String)
13 changes: 8 additions & 5 deletions telegramium-core/src/main/scala/telegramium/bots/Message.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ package telegramium.bots
* @param messageId
* Unique message identifier inside this chat
* @param from
* Optional. Sender, empty for messages sent to channels
* Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field
* contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
* @param senderChat
* Optional. Sender of the message, sent on behalf of a chat. The channel itself for channel messages. The supergroup
* itself for messages from anonymous group administrators. The linked channel for messages automatically forwarded
* to the discussion group
* Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the
* supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically
* forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in
* non-channel chats, if the message was sent on behalf of a chat.
* @param date
* Date the message was sent in Unix time
* @param chat
Expand All @@ -22,7 +24,8 @@ package telegramium.bots
* @param forwardFromMessageId
* Optional. For messages forwarded from channels, identifier of the original message in the channel
* @param forwardSignature
* Optional. For messages forwarded from channels, signature of the post author if present
* Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator,
* signature of the message sender if present
* @param forwardSenderName
* Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded
* messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ final case class CodeMessageEntity(offset: Int, length: Int) extends MessageEnti
*/
final case class BotCommandMessageEntity(offset: Int, length: Int) extends MessageEntity

/** spoiler
*
* @param offset
* Offset in UTF-16 code units to the start of the entity
* @param length
* Length of the entity in UTF-16 code units
*/
final case class SpoilerMessageEntity(offset: Int, length: Int) extends MessageEntity

/** email
*
* @param offset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@ import telegramium.bots.ChatId
* Unique identifier for the target chat or username of the target channel (in the format @channelusername)
* @param senderChatId
* Unique identifier of the target sender chat
* @param untilDate
* Date when the sender chat will be unbanned, unix time. If the chat is banned for more than 366 days or less than
* 30 seconds from the current time they are considered to be banned forever.
*/
final case class BanChatSenderChatReq(chatId: ChatId, senderChatId: Int, untilDate: Option[Int] = Option.empty)
final case class BanChatSenderChatReq(chatId: ChatId, senderChatId: Int)
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import telegramium.bots.KeyboardMarkup
* parse_mode
* @param disableNotification
* Sends the message silently. Users will receive a notification with no sound.
* @param protectContent
* Protects the contents of the sent message from forwarding and saving
* @param replyToMessageId
* If the message is a reply, ID of the original message
* @param allowSendingWithoutReply
Expand All @@ -37,6 +39,7 @@ final case class CopyMessageReq(
parseMode: Option[ParseMode] = Option.empty,
captionEntities: List[MessageEntity] = List.empty,
disableNotification: Option[Boolean] = Option.empty,
protectContent: Option[Boolean] = Option.empty,
replyToMessageId: Option[Int] = Option.empty,
allowSendingWithoutReply: Option[Boolean] = Option.empty,
replyMarkup: Option[KeyboardMarkup] = Option.empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ import telegramium.bots.ChatId
* @channelusername)
* @param disableNotification
* Sends the message silently. Users will receive a notification with no sound.
* @param protectContent
* Protects the contents of the forwarded message from forwarding and saving
* @param messageId
* Message identifier in the chat specified in from_chat_id
*/
final case class ForwardMessageReq(
chatId: ChatId,
fromChatId: ChatId,
disableNotification: Option[Boolean] = Option.empty,
protectContent: Option[Boolean] = Option.empty,
messageId: Int
)
Loading

0 comments on commit 4f3eb53

Please sign in to comment.