Skip to content

Releases: apimorphism/telegramium

Telegramium-4.52.2

13 May 23:02
982f607
Compare
Choose a tag to compare

Fix #120: Make PreMessageEntity's language optional

Telegramium-4.52.1

12 May 10:47
7c274fd
Compare
Choose a tag to compare

Fix #116: update Bot API return types

Telegramium-4.52.0

27 Apr 20:47
7a4ae93
Compare
Choose a tag to compare

Telegramium-4.52.0 released.
It supports all methods and entities of Telegram Bot API v5.2.

Excerpt from Bot API official announcement for version 5.2

  • Added support for Payments 2.0, including inline mode for invoices.
  • Added the field chat_type to the class InlineQuery.
  • And more, see the full changelog for details.

https://core.telegram.org/bots/api-changelog#april-26-2021

Telegramium-4.51.0

09 Mar 22:56
4822fbd
Compare
Choose a tag to compare

Telegramium-4.51.0 released.
It supports all methods and entities of Telegram Bot API v5.1.

This MAJOR release introduces significant breaking changes.

Notable changes

  • User identifiers are now stored as Longs.

Excerpt from Bot API official announcement for version 5.1

https://core.telegram.org/bots/api#march-9-2021

  • Added two new update types
    Added updates about member status changes in chats, represented by the class ChatMemberUpdated and the fields my_chat_member and chat_member in the Update class.
  • Improved Invite Links
  • Voice Chat Info
  • And More

⚠️ WARNING! ⚠️
After one of the upcoming Bot API updates, some user identifiers will become bigger than 2^31 - 1 and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

Telegramium-3.50.0

28 Jan 20:04
ccc1741
Compare
Choose a tag to compare

This MAJOR release introduces significant breaking changes.

Notable changes

  • Message entities (for example, hashtags, usernames, URLs, etc.) are now represented as an ADT.
  • Keyboard constructors has been moved to telegramium.bots.high.keyboards.
  • You can configure the WebhookBot's execution context.
  • Long poll updates are now processed concurrently.
  • Improved scaladocs.

Telegramium-2.50.0

05 Nov 13:05
Compare
Choose a tag to compare

Telegramium 2.50.0 released.
It supports all methods and entities of Telegram Bot API v5.0.

Excerpt from Bot API official announcement for version 5.0:

https://core.telegram.org/bots/api-changelog#november-4-2020

• New options for Webhooks.
• New method copyMessage to send a copy of any message.
• Support for Live Locations, including the latest changes.
• Support for Multiple Pinned Messages
• Support for File Albums
• Support for Anonymous Admins.
• Support for ⚽️ and 🎰 animated emoji.

Telegram Bot API error reporting enhancements.

Telegramium-2.49.0

05 Jul 16:13
Compare
Choose a tag to compare

Telegramium 2.49.0 released.
It supports all methods and entities of Telegram Bot API v4.9.

This MAJOR release introduces significant breaking changes.

Notable changes

  • The Methods fabric was added. You don't need to create *Req objects by hand now.
  • You can perform a request to the Bot API while sending an answer to the webhook.
  • All Update types are supported.

An excerpt from the documentation:

How to use

Create the dependency by adding the following lines to your build.sbt:

libraryDependencies += "io.github.apimorphism" %% "telegramium-core" % "2.49.0"
libraryDependencies += "io.github.apimorphism" %% "telegramium-high" % "2.49.0"

Imports:

import telegramium.bots.high._
import telegramium.bots.high.implicits._

Use the Methods fabric to create requests. You will need an instance of the BotApi class to execute them:

BlazeClientBuilder[F](ExecutionContext.global).resource.use { httpClient =>
  implicit val api: Api[F] = BotApi(http, baseUrl = s"https://api.telegram.org/bot$token")
  val bot = new MyLongPollBot()
  bot.start()
}

Long polling

class MyLongPollBot[F[_]: Sync: Timer]()(implicit api: Api[F]) extends LongPollBot[F](api) {
  override def onMessage(msg: Message): F[Unit] =
    Methods.sendMessage(chatId = ChatIntId(msg.chat.id), text = "Hello, world!").exec.void
}

LongPollBot and WebhookBot extend the Methods trait so you can call sendMessage directly.

Webhooks

class MyWebhookBot[F[_]: ConcurrentEffect: ContextShift: Timer](port: Int, url: String, path: String)(
  implicit api: Api[F]
) extends WebhookBot[F](api, port, url, path) {
  override def onMessage(msg: Message): F[Unit] =
    sendMessage(chatId = ChatIntId(msg.chat.id), text = "Hello, world!").exec.void
}

You can also perform a request to the Bot API while sending an answer to the webhook:

override def onMessageReply(msg: Message): F[Option[Method[_]]] =
  Sync[F].pure(Some(sendMessage(chatId = ChatIntId(msg.chat.id), text = "Hello, world!")))

Telegramium-1.49.0

06 Jun 06:46
5f74048
Compare
Choose a tag to compare

Telegramium 1.49.0 released.
It supports all methods and entities of Telegram Bot API v4.9.

Excerpt from Bot API official announcement for version 4.9:

https://core.telegram.org/bots/api-changelog#june-4-2020

  • Added the new field via_bot to the Message object. You can now know which bot was used to send a message.
  • Supported video thumbnails for inline GIF and MPEG4 animations.
  • Supported the new basketball animation for the random dice. Choose between different animations (dice, darts, basketball) by specifying the emoji parameter in the method sendDice.

Improvements to webhooks API and high by @johnspade .
Emoji enums.

Telegramium-1.48.0

24 Apr 12:38
5f4e3ff
Compare
Choose a tag to compare

Telegramium 1.48.0 released.
It supports all methods and entities of Telegram Bot API v4.8.

New versioning scheme now is in use, in X.Y.Z Y denotes the official API version, refer to README for more details.

Excerpt from Bot API official announcement for version 4.8:

https://core.telegram.org/bots/api-changelog#april-24-2020

  • Supported explanations for Quizzes 2.0. Add explanations by specifying the parameters explanation and explanation_parse_mode in the method sendPoll.
  • Added the fields explanation and explanation_entities to the Poll object.
  • Supported timed polls that automatically close at a certain date and time. Set up by specifying the parameter open_period or close_date in the method sendPoll.
  • Added the fields open_period and close_date to the Poll object.
  • Supported the new darts animation for the dice mini-game. Choose between the default dice animation and darts animation by specifying the parameter emoji in the method sendDice.
  • Added the field emoji to the Dice object.

Check out examples to see how to start.

Telegramium-1.0.0-RC5

20 Apr 09:49
09e18a3
Compare
Choose a tag to compare
Telegramium-1.0.0-RC5 Pre-release
Pre-release

This is the fifth release candidate for F[Tg] 1.0.0. It supports all methods and entities of Telegram Bot API v4.7.

Excerpt from Bot API official announcement:

https://core.telegram.org/bots/api-changelog#march-30-2020

  • Added the method sendDice for sending a dice message, which will have a random value from 1 to 6.
  • Added the field dice to the Message object.
  • Added the method getMyCommands for getting the current list of the bot's commands.
  • Added the method setMyCommands for changing the list of the bot's commands through the Bot API.
  • Added the ability to create animated sticker sets by specifying the parameter tgs_sticker.
  • Added the ability to add animated stickers to sets created by the bot by specifying the parameter tgs_sticker.
  • Added the field thumb to the StickerSet object.
  • Added the ability to change thumbnails of sticker sets created by the bot using the method setStickerSetThumb.