{"id":37028159,"url":"https://github.com/apimorphism/telegramium","last_synced_at":"2026-05-02T00:02:59.291Z","repository":{"id":36199158,"uuid":"189757352","full_name":"apimorphism/telegramium","owner":"apimorphism","description":"Telegramium or F[ Tg ] - pure functional Telegram Bot API implementation for Scala.","archived":false,"fork":false,"pushed_at":"2026-02-12T01:14:04.000Z","size":2654,"stargazers_count":87,"open_issues_count":1,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-02-12T11:33:16.517Z","etag":null,"topics":["cats","cats-effect","functional-programming","scala","telegram","telegram-bot-api"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apimorphism.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-06-01T16:58:17.000Z","updated_at":"2026-02-12T01:14:10.000Z","dependencies_parsed_at":"2024-03-30T16:29:08.024Z","dependency_job_id":"bc829716-124f-42e8-8b8b-0bcbac730e62","html_url":"https://github.com/apimorphism/telegramium","commit_stats":{"total_commits":584,"total_committers":12,"mean_commits":"48.666666666666664","dds":0.6044520547945205,"last_synced_commit":"bbd0bfeaac34e15be8861f54e55aa95f343ae3a5"},"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"purl":"pkg:github/apimorphism/telegramium","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apimorphism%2Ftelegramium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apimorphism%2Ftelegramium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apimorphism%2Ftelegramium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apimorphism%2Ftelegramium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apimorphism","download_url":"https://codeload.github.com/apimorphism/telegramium/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apimorphism%2Ftelegramium/sbom","scorecard":{"id":202799,"data":{"date":"2025-08-11","repo":{"name":"github.com/apimorphism/telegramium","commit":"67a61f92b0bc0a15807f9f24688f54d405ae77d3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.1,"checks":[{"name":"Code-Review","score":8,"reason":"Found 23/28 approved changesets -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":10,"reason":"18 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/clean.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/apimorphism/telegramium/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/apimorphism/telegramium/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/apimorphism/telegramium/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/apimorphism/telegramium/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/apimorphism/telegramium/ci.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T23:06:59.743Z","repository_id":36199158,"created_at":"2025-08-16T23:06:59.743Z","updated_at":"2025-08-16T23:06:59.743Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29434917,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T03:34:37.767Z","status":"ssl_error","status_checked_at":"2026-02-14T03:34:09.092Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cats","cats-effect","functional-programming","scala","telegram","telegram-bot-api"],"created_at":"2026-01-14T03:21:33.779Z","updated_at":"2026-05-02T00:02:59.284Z","avatar_url":"https://github.com/apimorphism.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# F[Tg] - Telegramium\n\n[![Telegram](https://img.shields.io/badge/Telegram%20Bot%20API-9.6%20(April%203%2C%202026)-blue)](https://core.telegram.org/bots/api#recent-changes)\n![Maven Central](https://img.shields.io/maven-central/v/io.github.apimorphism/telegramium-core_3)\n\nF[Tg] is a pure functional Telegram Bot API for Scala.\n\nThis project is a try to provide a comprehensive, well documented and Scala-idiomatic client/server implementations to work with Telegram Bot API. Please refer to telegramium-examples module for usage examples. There is a support both for polling and webhooks.\nAPI core is generated from the official documentation, so it is believed to cover all the available methods, entities and to be up to date.\n\nCurrently the following backends are supported:\n\n- http4s\n- cats-effect\n- circe\n\nYou may want to start with [Methods.scala](telegramium-core/src/main/scala/telegramium/bots/client/Methods.scala) and [EchoBot.scala](telegramium-examples/src/main/scala/telegramium/bots/examples/EchoBot.scala).\n\n### How to use\nCreate the dependency by adding the following lines to your build.sbt:\n\n```\nlibraryDependencies += \"io.github.apimorphism\" %% \"telegramium-core\" % \"\u003cversion\u003e\"\nlibraryDependencies += \"io.github.apimorphism\" %% \"telegramium-high\" % \"\u003cversion\u003e\"\n```\n\nImports:\n```scala\nimport telegramium.bots.high._\nimport telegramium.bots.high.implicits._\n```\n\nUse the `Methods` factory to create requests. You will need an instance of the `BotApi` class to execute them:\n```scala\nBlazeClientBuilder[F].resource.use { httpClient =\u003e\n  implicit val api: Api[F] = BotApi(httpClient, baseUrl = s\"https://api.telegram.org/bot$token\")\n  val bot = new MyLongPollBot()\n  bot.start()\n}\n```\n\n#### Long polling\n```scala\nclass MyLongPollBot[F[_]: Async: Parallel]()(implicit api: Api[F]) extends LongPollBot[F](api) {\n  override def onMessage(msg: Message): F[Unit] =\n    Methods.sendMessage(chatId = ChatIntId(msg.chat.id), text = \"Hello, world!\").exec.void\n}\n```\n\n`LongPollBot` and `WebhookBot` extend the `Methods` trait so you can call `sendMessage` directly.\n\n#### Webhooks\n```scala\nclass MyWebhookBot[F[_]: Async](url: String, path: String)(\n  implicit api: Api[F]\n) extends WebhookBot[F](api, url, path) {\n  override def onMessage(msg: Message): F[Unit] =\n    sendMessage(chatId = ChatIntId(msg.chat.id), text = \"Hello, world!\").exec.void\n}\n```\n\nYou can also perform a request to the Bot API while [sending an answer to the webhook](https://core.telegram.org/bots/api#making-requests-when-getting-updates):\n```scala\noverride def onMessageReply(msg: Message): F[Option[Method[_]]] =\n  Sync[F].pure(Some(sendMessage(chatId = ChatIntId(msg.chat.id), text = \"Hello, world!\")))\n```\nIn addition, the library provides a way to compose multiple Webhook\nbots into a single `Http4s` Server that will handle the webhooks\nregistration as well as the incoming requests of all the composed\nbots. You ultimately decide at which host:port the server will be\nbinded to:\n\n``` scala\nval api1: Api[IO] = BotApi(http, baseUrl = s\"https://api.telegram.org/bot$bot_token1\")\nval api2: Api[IO] = BotApi(http, baseUrl = s\"https://api.telegram.org/bot$bot_token1\")\nval bot1: MyWebhookbot = new MyWebhookbot[IO](api1, \"ServerVisibleFromOutside\", s\"/$bot_token1\")\nval bot2: MyWebhookbot = new MyWebhookbot[IO](api2, \"ServerVisibleFromOutside\", s\"/$bot_token2\")\n\nWebhookBot.compose[IO](\n    List(bot1, bot2),\n    8080,\n    \"127.0.0.1\" //optional, localhost as default\n  ).useForever.runSyncUnsafe()\n```\n\nFor details, have a look\nat the [Github Issue](https://github.com/apimorphism/telegramium/issues/143) and\nthe related [Pull Request](https://github.com/apimorphism/telegramium/pull/145).\n\n#### OpenEnum\n\nThe Telegram Bot API is not versioned, which means bots and libraries must try to be forward-compatible. Specifically for enumerations, this implies that bots should always anticipate new values being added. Handling these values depends on the bot's business logic. Some apps may simply ignore unknown values, while others might respond with \"This message is not supported,\" save the message for manual processing later, or throw a request handling error.\n\nTelegramium introduces `OpenEnum`, a wrapper for Telegram Bot API enumerations with two cases: `Known` and `Unknown`. This type allows unknown values to be explicitly handled (similar to `Option` or `Either`), enabling bots using Telegramium to be more robust, improve error handling, and degrade gracefully in light of frequent Telegram Bot API updates.\n\n#### Keyboards\nTo use smart and safe constructors for keyboard markups, import `telegramium.bots.high.keyboards._`:\n```scala\nval button: KeyboardButton = KeyboardButtons.text(\"Hello, world!\")\nval keyboard: ReplyKeyboardMarkup = ReplyKeyboardMarkups.singleButton(button)\n\nval inlineButton: InlineKeyboardButton =\n  InlineKeyboardButtons.callbackData(text = \"Press me\", callbackData = \"button_pressed\")\n\nval inlineKeyboard: InlineKeyboardMarkup =\n  InlineKeyboardMarkups.singleButton(inlineButton)\n```\n\n#### Message entities\n\n`telegramium.bots.high.messageentities.MessageEntities` is a utility class to work with styled messages using [message entities](https://core.telegram.org/bots/api#messageentity). Compose your message's text using different formatting options like plain text, bold, italics, links, mentions, hashtags and more. \nThis class automatically takes care of calculating text offsets and lengths required by the Telegram API.\n\n```scala\nimport telegramium.bots.high.messageentities.*\n\nval msgEntities = MessageEntities()\n  .bold(\"Hello, \")\n  .mention(\"@user\")\n  .plain(\"! Welcome to our \")\n  .textLink(\"website\", \"https://example.com\")\n  .lineBreak()\n  .plain(\"Enjoy your stay.\")\n\nMethods.sendMessage(\n  chatId,\n  // Hello, @user! Welcome to our website\\nEnjoy your stay.\n  text = msgEntities.toPlainText(),\n  // List(BoldMessageEntity(0, 7), MentionMessageEntity(7, 5), TextLinkMessageEntity(29, 7, \"https://example.com\"))\n  entities = msgEntities.toTelegramEntities()\n)\n```\n\n### Versioning\n\nX.Y.Z where\n\n* X major changes to telegramium high or internals of the core.\n* Y denotes Telegram Bot API version which is supported by this `X.Y.Z`.\n* Z bug fix changes.\n\nPlease, note, that this versioning scheme is started from version `1.48.0`.\n\n### Contribution\n\nI'd love to have more testing and more example bots. Ideas and PRs on telegramium-high -\nhigh level interface for the bot API are also highly encouraged.\n\nIf you want to change something in telegramium-core or found a bug in it, please create an issue.\nDo not create pull requests with changes on telegramium-core as we use semi-automatic way to work with it.\nExcept that any PR-s are welcome.\n\nBefore you submit the PR, ensure that you've formatted your code by running the `sbt fmtAll` command.\n\n### Alternatives\n\nYou may also want to have a look at these projects:\n* [augustjune/canoe](https://github.com/augustjune/canoe)\n* [bot4s/telegram](https://github.com/bot4s/telegram)\n\n### Known usages\n\n* [johnspade/taskobot-scala](https://github.com/johnspade/taskobot-scala): Taskobot is a task collaboration inline Telegram bot. \nPerhaps the most up-to-date bot from a Telegramium mantainer, built with ZIO.\n* [johnspade/s10ns_bot](https://github.com/johnspade/s10ns_bot): Subscription Management Telegram Bot\n* [TurtleBots/playcs](https://github.com/TurtleBots/playcs): create dedicated servers for CS 1.6 client\n* [TurtleBots/gdetram](https://github.com/TurtleBots/gdetram): public transport arrival tabloid with chat bot interface\n* [b1nd/stonks](https://github.com/b1nd/stonks): Investment Portfolio Calculation Bot\n* [benkio/myTelegramBot](https://github.com/benkio/myTelegramBot)\n* [TurtleBots/adjutant](https://github.com/TurtleBots/adjutant): adjutant provides shareplace for sc2 builds through the chatbot\n* [TurtleBots/bender](https://github.com/TurtleBots/bender): undefeatable tic-tac-toe player\n* [a-khakimov/undicator](https://github.com/a-khakimov/undicator): simple bot for viewing unsplash user statistics\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapimorphism%2Ftelegramium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapimorphism%2Ftelegramium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapimorphism%2Ftelegramium/lists"}