{"id":21444284,"url":"https://github.com/dynastymasra/telegraph","last_synced_at":"2025-08-20T21:16:23.017Z","repository":{"id":57611001,"uuid":"108062926","full_name":"dynastymasra/telegraph","owner":"dynastymasra","description":"Telegram bot API Go SDK","archived":false,"fork":false,"pushed_at":"2018-01-23T09:40:19.000Z","size":179,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T11:13:54.684Z","etag":null,"topics":["backoff","go","golang","sdk","telegram"],"latest_commit_sha":null,"homepage":null,"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/dynastymasra.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":"2017-10-24T01:46:09.000Z","updated_at":"2019-01-12T13:30:50.000Z","dependencies_parsed_at":"2022-09-11T04:50:42.857Z","dependency_job_id":null,"html_url":"https://github.com/dynastymasra/telegraph","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynastymasra%2Ftelegraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynastymasra%2Ftelegraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynastymasra%2Ftelegraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynastymasra%2Ftelegraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dynastymasra","download_url":"https://codeload.github.com/dynastymasra/telegraph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243955803,"owners_count":20374373,"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":["backoff","go","golang","sdk","telegram"],"created_at":"2024-11-23T02:17:02.137Z","updated_at":"2025-03-17T01:16:09.910Z","avatar_url":"https://github.com/dynastymasra.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegraph\n\n[![Build Status](https://travis-ci.org/dynastymasra/telegraph.svg?branch=master)](https://travis-ci.org/dynastymasra/telegraph)\n[![Coverage Status](https://coveralls.io/repos/github/dynastymasra/telegraph/badge.svg?branch=master)](https://coveralls.io/github/dynastymasra/telegraph?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/dynastymasra/telegraph)](https://goreportcard.com/report/github.com/dynastymasra/telegraph)\n[![GoDoc](https://godoc.org/github.com/dynastymasra/telegraph?status.svg)](https://godoc.org/github.com/dynastymasra/telegraph)\n[![Version](https://img.shields.io/badge/version-2.0.0-orange.svg)](https://github.com/dynastymasra/telegraph/tree/2.0.0)\n[![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\nTelegraph is Telegram bot API SDK for Go(Golang), Can use back off retry request to Telegram bot API\n\nReference to Telegram bot API [Documentation](https://core.telegram.org/bots/api)\n\n\n## Installation\n\n```bash\n$ go get github.com/dynastymasra/telegraph\n```\n\n## How to use\n\nimport library `github.com/dynastymasra/telegraph`, \nSee Telegram API [Documentation](https://core.telegram.org/bots/api#available-methods) to know available method can used, \nand what params can use in a method.\n\nCreate new client with no use back off retry, use params `access token` obtain from telegram bot father.\n```go\nclient := telegraph.NewClient(\u003caccess_token\u003e)\n\nres, err := client.SetWebHook(\"https://www.cubesoft.co.id\").SetCertificate(\"./LICENSE\").SetMaxConnection(100).SetAllowedUpdates(\"1\", \"2\", \"3\").Commit()\nif err != nil {\n\t// Do something when error\n}\n\ninfo, res, err := client.GetWebHookInfo().Commit()\nif err != nil {\n\t// Do something when error\n}\n```\n\nCreate new client with use back off retry, with params `access token` obtain from telegram bot father and `max interval` and `max elapsed time`\n```go\nclient := telegraph.NewClientWithBackOff(\u003caccess_token\u003e, telegraph.NewBackOff(\u003cmax_interval\u003e, \u003cmax_elapsed_time\u003e))\n\nres, err := client.DeleteWebHook().Commit()\nif err != nil {\n\t// Do something when error\n}\n```\n\nParse telegram web hook request, reference to telegram [Documentation](https://core.telegram.org/bots/api#getting-updates)\n\n```go\nmessage, err := telegraph.WebHookParseRequest(\u003crequest_in_[]byte\u003e)\nif err != nil {\n\t// Do something when error\n}\n```\n\nSend message to telegram use Telegraph SDK\n\n```go\nclient := telegraph.NewClientWithBackOff(\u003caccess_token\u003e, telegraph.NewBackOff(\u003cmax_interval\u003e, \u003cmax_elapsed_time\u003e))\n\n// Use upload false if file from url\nmessage, res, err := client.SendPhoto(\u003cchat_id\u003e, \"http://www.images.com/images/jpg\", false).SetCaption(\"test image\").Commit()\nif err != nil {\n\t// Do something when error\n}\n// Use upload true if from path file\n\nmessage, res, err := client.SendAudio(\u003cchat_id\u003e, \"/home/audio/audio.mp3\", true).SetCaption(\"test audio\").SetDuration(1000).Commit()\nif err != nil {\n\t// Do something when error\n}\n```\n\n## Contributing\n\nIf you find any issue you want to fix it, feel free to send me a pull request. \nAnd also if you have idea for improvement this library, feel free to send me a pull request.\n\n## Library\n\n* [GoRequest](https://github.com/parnurzeal/gorequest) - Simplified HTTP client ( inspired by famous SuperAgent lib in Node.js )\n* [Backoff](https://github.com/cenkalti/backoff) - The exponential backoff algorithm in Go (Golang)\n* [Gock](https://github.com/h2non/gock) - HTTP traffic mocking and expectations made easy for Go\n* [Testify](https://github.com/stretchr/testify) - A toolkit with common assertions and mocks that plays nicely with the standard library","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynastymasra%2Ftelegraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdynastymasra%2Ftelegraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynastymasra%2Ftelegraph/lists"}