{"id":23818939,"url":"https://github.com/rogozhka/tgwrap","last_synced_at":"2026-02-10T07:31:45.816Z","repository":{"id":40697917,"uuid":"117294264","full_name":"rogozhka/tgwrap","owner":"rogozhka","description":"Go library with Telegram Bot 🤖 API bindings. Simple optional params. No extra framework-like functions.","archived":false,"fork":false,"pushed_at":"2022-11-02T15:44:09.000Z","size":548,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-19T16:46:41.692Z","etag":null,"topics":["api-client","chatbot","golang-library","telegram","telegram-bot-api","telegram-bots"],"latest_commit_sha":null,"homepage":"","language":"Go","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/rogozhka.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}},"created_at":"2018-01-12T22:34:53.000Z","updated_at":"2024-06-19T16:46:41.693Z","dependencies_parsed_at":"2022-08-19T04:11:38.777Z","dependency_job_id":null,"html_url":"https://github.com/rogozhka/tgwrap","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogozhka%2Ftgwrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogozhka%2Ftgwrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogozhka%2Ftgwrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogozhka%2Ftgwrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rogozhka","download_url":"https://codeload.github.com/rogozhka/tgwrap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232158527,"owners_count":18480891,"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":["api-client","chatbot","golang-library","telegram","telegram-bot-api","telegram-bots"],"created_at":"2025-01-02T06:19:23.885Z","updated_at":"2026-02-10T07:31:45.759Z","avatar_url":"https://github.com/rogozhka.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](https://godoc.org/github.com/rogozhka/tgwrap?status.svg)](https://godoc.org/github.com/rogozhka/tgwrap)\n[![Travis](https://travis-ci.org/rogozhka/tgwrap.svg?branch=master)](https://travis-ci.org/rogozhka/tgwrap)\n[![Go Report Card](https://goreportcard.com/badge/github.com/rogozhka/tgwrap)](https://goreportcard.com/report/github.com/rogozhka/tgwrap)\n\n**TgWrap** is a Go library with [Telegram Bot API](https://core.telegram.org/bots/api) bindings. General approach is to keep objects as close as possible to the API structures with respect to optional params. Results of the methods are the same as noted in API documentation. Library does not pretend to be framework with tons of handlers and application strategy in mind. But there are some private helpers w/ reflection and struct tags under the hood. The aim is to cover step by step all the methods including Payment section.\n\n\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"fmt\"\n\t\"github.com/rogozhka/tgwrap\"\n)\n\nfunc main() {\n\n\tbot := tgwrap.NewBot(\"\u003ctoken\u003e\")\n\n  \t// returns *User\n\tme, err := bot.GetMe()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlog.Printf(\"BotID:%v\", me.ID)\n\tlog.Printf(\"BotName:%v\", me.FirstName)\n\n\tupdates, err := bot.GetUpdates(\u0026tgwrap.GetUpdatesOpt{\n\t\tTimeout: 60,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, u := range updates {\n\n\t\tlog.Printf(\"UpdateID:%v\", u.ID)\n\t\tlog.Printf(\"MessageID:%v\", u.Message.ID)\n\t\tlog.Printf(\"ChatID:%v\", u.Message.Chat.ID)\n\t\tlog.Printf(\"Text:%v\", u.Message.Text)\n\t\tlog.Printf(\"UserID:%v\", u.Message.From.ID)\n\t\tlog.Printf(\"FirstName:%v\", u.Message.From.FirstName)\n\n\t\t// reply to message with \"Re: \u003coriginal message\u003e\"\n\t\tbot.SendMessage(u.Message.Chat.ID, fmt.Sprintf(\"Re: %v\", u.Message.Text),\n\t\t\t\u0026tgwrap.SendMessageOpt{\n\t\t\t\tDisableNotification: true,\n\t\t\t})\n\n\t\t// send photo from URL\n\t\tbot.SendPhoto(u.Message.Chat.ID,\n             tgwrap.NewInputFileFromURL(\"http://imageurl.com/test.jpg\"),\n\t\t\t\u0026tgwrap.SendPhotoOpt{\n\t\t\t\tDisableNotification: true,\n\t\t\t\tCaption:             \"Test gray photo\",\n\t\t\t})\n\n\t\tbot.SendChatAction(u.Message.Chat.ID, tgwrap.ChatActionUploadPhoto)\n\n\t\t// send photo from fs\n\t\tbot.SendPhoto(u.Message.Chat.ID,\n\t\t\ttgwrap.NewInputFileLocal(\"/tmp/local-file-name.jpg\"),\n\t\t\t\u0026tgwrap.SendPhotoOpt{\n\t\t\t\tDisableNotification: true,\n\t\t\t\tCaption:             \"Photo from webcam ;)\",\n\t\t\t})\n\n\t\tbot.SendChatAction(u.Message.Chat.ID, tgwrap.ChatActionRecordAudio)\n\n\t\t// send audio from fs\n\t\tbot.SendAudio(u.Message.Chat.ID,\n\t\t\ttgwrap.NewInputFileLocal(\"/tmp/song.mp3\"),\n\t\t\t\u0026tgwrap.SendAudioOpt{\n\t\t\t\tDisableNotification: true,\n\t\t\t\tTitle:               \"Song name\",\n\t\t\t\tPerformer:           \"The Family Band\",\n\t\t\t\tCaption:             \"Lastest record\",\n\t\t\t})\n\t}\n}\n```\n\n\n\n## Currently supported methods\n\n[BotUpdatesInterface](https://pkg.go.dev/github.com/rogozhka/tgwrap#BotUpdatesInterface) group of methods to get updates and setup hooks:\n\n- [x] [getUpdates](https://core.telegram.org/bots/api#getupdates)\n\n- [x] setWebhook\n\n- [x] deleteWebhook\n\n- [x] getWebhookInfo\n\n\n\n\n\n[BotMessagesInterface](https://pkg.go.dev/github.com/rogozhka/tgwrap#BotMessagesInterface) to send messages and chat actions:\n\n- [x] [sendMessage](https://core.telegram.org/bots/api#sendmessage)\n- [x] [forwardMessage](https://core.telegram.org/bots/api#forwardmessage)\n\n\n\n\n[BotChatInterface](https://pkg.go.dev/github.com/rogozhka/tgwrap#BotChatInterface) to interact with chat state and settings:\n\n- [x] [sendChatAction](https://core.telegram.org/bots/api#sendchataction)\n\n- [ ] ...\n\n\n\n\n[BotMediaInterface](https://pkg.go.dev/github.com/rogozhka/tgwrap#BotMediaInterface) for sending media objects, encoding local files, by url, file_id:\n\n- [x] [sendPhoto](https://core.telegram.org/bots/api#sendphoto)\n\n- [x] [sendAudio](https://core.telegram.org/bots/api#sendaudio)\n\n- [x] [sendVideo](https://core.telegram.org/bots/api#sendvideo)\n\n- [x] [sendVoice](https://core.telegram.org/bots/api#sendvoice)\n\n- [x] [sendDocument](https://core.telegram.org/bots/api#senddocument)\n\n- [x] sendVideoNote\n\n- [ ] sendMediaGroup\n\n- [ ] ...\n\n\n\n## Contribution\n\nWelcome feedback Issues and PR.\n\n\n\n## Licence\n\nReleased under the [MIT License](https://github.com/rogozhka/tgwrap/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogozhka%2Ftgwrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frogozhka%2Ftgwrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogozhka%2Ftgwrap/lists"}