{"id":30613458,"url":"https://github.com/bondiano/telega-gleam","last_synced_at":"2026-02-24T11:03:10.619Z","repository":{"id":229369320,"uuid":"776031940","full_name":"bondiano/telega-gleam","owner":"bondiano","description":"Gleam library to build Telegram bots","archived":false,"fork":false,"pushed_at":"2025-10-20T14:57:36.000Z","size":1170,"stargazers_count":41,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-20T16:42:03.038Z","etag":null,"topics":["gleam","telegram","telegram-bots"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/telega/","language":"Gleam","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bondiano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-03-22T14:42:01.000Z","updated_at":"2025-10-20T14:56:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"069cafaa-e093-44d5-aa59-154c2924ea68","html_url":"https://github.com/bondiano/telega-gleam","commit_stats":null,"previous_names":["bondiano/telega","bondiano/telega-gleam"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/bondiano/telega-gleam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bondiano%2Ftelega-gleam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bondiano%2Ftelega-gleam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bondiano%2Ftelega-gleam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bondiano%2Ftelega-gleam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bondiano","download_url":"https://codeload.github.com/bondiano/telega-gleam/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bondiano%2Ftelega-gleam/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280906431,"owners_count":26411413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["gleam","telegram","telegram-bots"],"created_at":"2025-08-30T06:01:30.965Z","updated_at":"2025-10-25T04:53:53.308Z","avatar_url":"https://github.com/bondiano.png","language":"Gleam","funding_links":[],"categories":["Packages"],"sub_categories":["API Clients"],"readme":"# Telega\n\n[![Package Version](https://img.shields.io/hexpm/v/telega)](https://hex.pm/packages/telega)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/telega/)\n\nA [Gleam](https://gleam.run/) library for the Telegram Bot API on BEAM.\n\n\u003ca href=\"#\" target=\"blank\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/bondiano/telega-gleam/refs/heads/master/docs/logo.png\" alt=\"Telega\" width=\"244\" style=\"display: block; margin: 0 auto;\" /\u003e\n\u003c/a\u003e\n\n## It provides\n\n- an interface to the Telegram Bot HTTP-based APIs `telega/api`\n- an client for the Telegram Bot API `telega/client`\n- adapter to use with [wisp](https://github.com/gleam-wisp/wisp)\n- polling implementation\n- session bot implementation\n- conversation implementation\n- convenient utilities for common tasks\n\n## Quick start\n\n\u003e If you are new to Telegram bots, read the official [Introduction for Developers](https://core.telegram.org/bots) written by the Telegram team.\n\nFirst, visit [@BotFather](https://t.me/botfather) to create a new bot. Copy **the token** and save it for later.\n\nInitiate a gleam project and add `telega` as a dependencies:\n\n```sh\n$ gleam new first_tg_bot\n$ cd first_tg_bot\n$ gleam add telega\n```\n\nReplace the `first_tg_bot.gleam` file content with the following code:\n\n```gleam\nimport telega\nimport telega/polling\nimport telega/reply\nimport telega/router\nimport telega/update\n\nfn handle_text(ctx, text) {\n  use ctx \u003c- telega.log_context(ctx, \"echo_text\")\n  let assert Ok(_) = reply.with_text(ctx, text)\n  Ok(ctx)\n}\n\nfn handle_command(ctx, command: update.Command) {\n  use ctx \u003c- telega.log_context(ctx, \"echo_command\")\n  let assert Ok(_) = reply.with_text(ctx, \"Command: \" \u003c\u003e command.text)\n  Ok(ctx)\n}\n\npub fn main() {\n  let router =\n    router.new(\"echo_bot\")\n    |\u003e router.on_any_text(handle_text)\n    |\u003e router.on_commands([\"start\", \"help\"], handle_command)\n\n  let assert Ok(bot) =\n    telega.new_for_polling(token: \"BOT_TOKEN\")\n    |\u003e telega.with_router(router)\n    |\u003e telega.init_for_polling_nil_session()\n\n  let assert Ok(poller) = polling.start_polling_default(bot)\n\n  polling.wait_finish(poller)\n}\n```\n\nReplace `\"BOT_TOKEN\"` with the token you received from the BotFather. Then run the bot:\n\n```sh\n$ gleam run\n```\n\nAnd it will echo all received text messages.\n\nCongratulations! You just wrote a Telegram bot :)\n\n## Examples\n\nOther examples can be found in the [examples](./examples) directory.\n\n## Development\n\n```sh\ngleam run   # Run the project\ngleam test  # Run the tests\ngleam shell # Run an Erlang shell\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbondiano%2Ftelega-gleam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbondiano%2Ftelega-gleam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbondiano%2Ftelega-gleam/lists"}