{"id":45073897,"url":"https://github.com/nexor/telega","last_synced_at":"2026-02-19T13:10:23.993Z","repository":{"id":49002204,"uuid":"128529627","full_name":"nexor/telega","owner":"nexor","description":"Telegram Bot API implementation","archived":false,"fork":false,"pushed_at":"2026-02-13T13:17:33.000Z","size":198,"stargazers_count":26,"open_issues_count":13,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-02-13T22:29:25.255Z","etag":null,"topics":["dlang","telegram","telegram-bot-api"],"latest_commit_sha":null,"homepage":null,"language":"D","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/nexor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-04-07T13:13:32.000Z","updated_at":"2026-02-13T13:17:38.000Z","dependencies_parsed_at":"2025-09-11T17:27:30.434Z","dependency_job_id":"caa602d0-a8f9-4f03-be9d-80fba061f560","html_url":"https://github.com/nexor/telega","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/nexor/telega","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexor%2Ftelega","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexor%2Ftelega/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexor%2Ftelega/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexor%2Ftelega/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nexor","download_url":"https://codeload.github.com/nexor/telega/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexor%2Ftelega/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29614630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T13:04:20.082Z","status":"ssl_error","status_checked_at":"2026-02-19T13:03:33.775Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["dlang","telegram","telegram-bot-api"],"created_at":"2026-02-19T13:10:21.487Z","updated_at":"2026-02-19T13:10:23.988Z","avatar_url":"https://github.com/nexor.png","language":"D","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telega\n[Telegram bot API](https://core.telegram.org/bots/api) implementation.\n\n[![Dub version](https://img.shields.io/dub/v/telega.svg)](http://code.dlang.org/packages/telega)\n[![Build Status](https://travis-ci.org/nexor/telega.svg?branch=master)](https://travis-ci.org/nexor/telega)\n\n## Run examples\nTo run examples from `examples/` dir you need to [create a bot](https://core.telegram.org/bots#6-botfather) and\nput it as BOT_TOKEN variable in `.env` file at the root of this repository.\n\n```\n$ cat .env\nBOT_TOKEN=123456789:BotTokenHere\n```\n\nNow you can run examples using make command\n```\n$ make run-example-echobot\n$ make run-example-keyboard\n$ make run-example-pollbot\n```\n\n## Quickstart\n\nSimple echo bot example\n\n```d\nimport vibe.core.core : runApplication, runTask;\nimport vibe.core.log : setLogLevel, logInfo, LogLevel;\nimport std.process : environment;\nimport std.exception : enforce;\n\nint main(string[] args)\n{\n    string botToken = environment.get(\"BOT_TOKEN\");\n\n    if (args.length \u003e 1 \u0026\u0026 args[1] != null) {\n        logInfo(\"Setting token from first argument\");\n        botToken = args[1];\n    }\n\n    enforce(botToken !is null, \"Please provide bot token as a first argument or set BOT_TOKEN env variable\");\n\n    setLogLevel(LogLevel.diagnostic);\n    runTask(\u0026listenUpdates, botToken);\n\n    return runApplication();\n}\n\nvoid listenUpdates(string token)\n{\n    import telega.botapi : BotApi;\n    import telega.telegram.basic : Update, getUpdates, sendMessage;\n    import std.algorithm.iteration : filter, each;\n    import std.algorithm.comparison : max;\n\n    int offset;\n    auto api = new BotApi(token);\n\n    while (true)\n    {\n        api.getUpdates(offset)\n            .filter!(u =\u003e !u.message.text.isNull) // we need all updates with text message\n            .each!((Update u) {\n                logInfo(\"Text from %s: %s\", u.message.chat.id, u.message.text);\n                api.sendMessage(u.message.chat.id, u.message.text);\n                offset = max(offset, u.id)+1;\n            });\n    }\n}\n```\n\n## Installation\nYou can add package to your project using dub:\n```\ndub add telega\n```\n\n## Todo\n\n - [ ] Sending files\n - [ ] Inline mode\n - [ ] Bot API 4.3 and newer\n\n## Help\nYou can find some examples in the [examples dir](examples/)\n\nAPI types and methods can be found in telega.telegram.* modules.\n\nEach method is typically implemented using 3 constructs:\n - structure for the method fully describing its signature;\n - a function that accepts a few arguments representing required method arguments\n - a function that accepts a reference to a method struct for calling method with required and optional arguments\n\nFor example:\n```d\n// full method structure\nstruct SendMessageMethod\n{\n    mixin TelegramMethod!\"/sendMessage\";\n\n    ChatId    chat_id;\n    string    text;\n    Nullable!ParseMode parse_mode;\n    Nullable!bool      disable_web_page_preview;\n    Nullable!bool      disable_notification;\n    Nullable!uint      reply_to_message_id;\n\n    ReplyMarkup reply_markup;\n}\n\n// short form - only required args\nMessage sendMessage(T)(BotApi api, T chatId, string text) if (isTelegramId!T)\n\n// full form - need to build SendTelegramMethod struct first\nMessage sendMessage(BotApi api, ref SendMessageMethod m)\n```\n\n### Some hints\n`ChatId` type is actually `long` or `string`\n\n`isTelegramId!T` template checks `T` to be some string or number\n\n### Support\n[Issues](https://github.com/nexor/telega/issues) and PR's are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexor%2Ftelega","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnexor%2Ftelega","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexor%2Ftelega/lists"}