{"id":13465371,"url":"https://github.com/givip/Telegrammer","last_synced_at":"2025-03-25T16:31:38.272Z","repository":{"id":47268942,"uuid":"122159369","full_name":"givip/Telegrammer","owner":"givip","description":"Telegram Bot - written with Swift 5.2 / NIO, supports Linux, macOS","archived":false,"fork":false,"pushed_at":"2021-09-06T02:09:40.000Z","size":682,"stargazers_count":289,"open_issues_count":7,"forks_count":41,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-10-07T08:46:50.445Z","etag":null,"topics":["server-side-swift","swift","swift-package-manager","swift5","swiftnio","telegram","telegram-bot","telegram-bot-api","ubuntu","vapor"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/givip.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-20T05:32:11.000Z","updated_at":"2024-09-24T22:19:54.000Z","dependencies_parsed_at":"2022-08-25T14:30:29.055Z","dependency_job_id":null,"html_url":"https://github.com/givip/Telegrammer","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/givip%2FTelegrammer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/givip%2FTelegrammer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/givip%2FTelegrammer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/givip%2FTelegrammer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/givip","download_url":"https://codeload.github.com/givip/Telegrammer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222088540,"owners_count":16928976,"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","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":["server-side-swift","swift","swift-package-manager","swift5","swiftnio","telegram","telegram-bot","telegram-bot-api","ubuntu","vapor"],"created_at":"2024-07-31T15:00:28.535Z","updated_at":"2024-10-29T17:30:48.123Z","avatar_url":"https://github.com/givip.png","language":"Swift","funding_links":[],"categories":["Libs","Bots [🔝](#readme)","Swift","CLI and Server"],"sub_categories":["Bots"],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://gp-apps.com/github/telegrammer_logo.png\" alt=\"SwiftyBot Banner\"\u003e\u003c/p\u003e\n\n# Telegrammer\nTelegram Bot Framework written in Swift 5.1 with SwiftNIO network framework\n\n[![Build](https://circleci.com/gh/givip/Telegrammer/tree/master.svg?style=shield\u0026circle-token=04a84114573c1c6b3039ef82b88e54f1f6b8c512)](https://circleci.com/gh/givip/Telegrammer)\n[![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)](https://github.com/givip/Telegrammer/releases)\n[![Language](https://img.shields.io/badge/language-Swift%205.1-orange.svg)](https://swift.org/download/)\n[![Platform](https://img.shields.io/badge/platform-Linux%20/%20macOS-ffc713.svg)](https://swift.org/download/)\n[![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/givip/Telegrammer/blob/master/LICENSE)\n\n\nWhat does it do\n---------------\n\nTelegrammer is open-source framework for Telegram Bots developers.\nIt was built on top of [Apple/SwiftNIO](https://github.com/apple/swift-nio)\n\nJoin to our [Telegram developers chat](https://t.me/joinchat/AzGW3kkUjLoK2dr3CZFrFQ)\nJoin to our [Telegrammer channel](https://discord.gg/yjspy8b) on [Vapor Discord server](https://discord.gg/3jG8QFV) \n\nThe simplest code of Echo Bot looks like this:\n\n-------------\n_main.swift_\n```swift\nimport Foundation\nimport Telegrammer\n\ndo {\n    let bot = try Bot(token: \"BOT_TOKEN_HERE\")\n\n    let echoHandler = MessageHandler { (update, _) in\n        _ = try? update.message?.reply(text: \"Hello \\(update.message?.from?.firstName ?? \"anonymous\")\", from: bot)\n    }\n\n    let dispatcher = Dispatcher(bot: bot)\n    dispatcher.add(handler: echoHandler)\n\n    _ = try Updater(bot: bot, dispatcher: dispatcher).startLongpolling().wait()\n} catch {\n    exit(1)\n}\n```\n\nDocumentation\n---------------\n\n- Read [An official introduction for developers](https://core.telegram.org/bots) \n- Check out [bot FAQ](https://core.telegram.org/bots/faq)\n- Official [Telegram Bot API](https://core.telegram.org/bots/api)\n\n\nUsage without Vapor\n---------------\n\n- Use the template repository as a example [https://github.com/givip/telegrammer-bot-template.git](https://github.com/givip/telegrammer-bot-template.git)\n- Current repository contains five examples of bot implementation:\nhttps://github.com/givip/Telegrammer/tree/master/Sources/DemoEchoBot\nhttps://github.com/givip/Telegrammer/tree/master/Sources/DemoHelloBot\nhttps://github.com/givip/Telegrammer/tree/master/Sources/DemoSchedulerBot\nhttps://github.com/givip/Telegrammer/tree/master/Sources/DemoSpellCheckerBot\nhttps://github.com/givip/Telegrammer/tree/master/Sources/DemoWebhooksLocally\n\nUsage with Vapor\n---------------\n\n- Use the  [https://github.com/givip/telegrammer-bot-vapor-template.git](https://github.com/givip/telegrammer-bot-vapor-template.git)\n\nDemo bots\n---------------\n\n#### All sample bots\n1. Add Telegram Token in [Environment Variables](http://nshipster.com/launch-arguments-and-environment-variables/), so, either create an environment variable:\n```\n$ export TELEGRAM_BOT_TOKEN='000000000:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'\n```\n2. Run Bot executable scheme or\n```\n$ swift run\n```\n\n\n[EchoBot sources](https://github.com/givip/Telegrammer/tree/master/Sources/EchoBot)\nStarts/stops with command \"/echo\", then simply responds with your message\n\n[HelloBot sources](https://github.com/givip/Telegrammer/tree/master/Sources/HelloBot)\nSays \"Hello\" to new users in group. Responds with \"hello\" message on command \"/greet\"\n\n[SchedulerBot sources](https://github.com/givip/Telegrammer/tree/master/Sources/SchedulerBot)\nDemonstrate Jobs Queue scheduling mechanism. \nCommand \"/start X\" starts repeatable job, wich will send you a message each X seconds.\nCommand \"/once X\" will send you message once after timeout of X seconds.\nCommand \"/stop\" stops JobsQueue only for you. Other users continues to receive scheduled messages.\n\n[SpellCheckerBot sources](https://github.com/givip/Telegrammer/tree/master/Sources/SpellCheckerBot)\nDemonstrate how works InlineMenus and Callback handlers.\nCommand \"/start\" will start bot.\nSend any english text to bot and it will be checked for mistakes. Bot will propose you some fixes in case of found mistake.\n\nRequirements\n---------------\n\n- Ubuntu 16.04 or later with [Swift 5.1 or later](https://swift.org/getting-started/) / macOS with [Xcode 11 or later](https://swift.org/download/)\n- Telegram account and a Telegram App for any platform\n- [Swift Package Manager (SPM)](https://github.com/apple/swift-package-manager/blob/master/Documentation/Usage.md) for dependencies \n- [Vapor 4](https://vapor.codes) (optionally, for bots with database and other server side stuff)\n\nContributing\n---------------\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) file.\n\nAuthor\n---------------\n\nGivi Pataridze\n\n[pataridzegivi@gmail.com](mailto:pataridzegivi@gmail.com)\n[@givip](tg://user?id=53581534)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgivip%2FTelegrammer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgivip%2FTelegrammer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgivip%2FTelegrammer/lists"}