{"id":15311077,"url":"https://github.com/talentlessguy/telegram-bot-stats","last_synced_at":"2025-04-14T23:27:27.947Z","repository":{"id":64973531,"uuid":"270042779","full_name":"talentlessguy/telegram-bot-stats","owner":"talentlessguy","description":"Go library for collecting usage stats of telegram bots.","archived":false,"fork":false,"pushed_at":"2022-08-11T17:59:36.000Z","size":2,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T11:37:15.177Z","etag":null,"topics":["telegram","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/talentlessguy.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}},"created_at":"2020-06-06T16:48:47.000Z","updated_at":"2023-08-25T21:39:19.000Z","dependencies_parsed_at":"2022-12-23T00:25:45.623Z","dependency_job_id":null,"html_url":"https://github.com/talentlessguy/telegram-bot-stats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talentlessguy%2Ftelegram-bot-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talentlessguy%2Ftelegram-bot-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talentlessguy%2Ftelegram-bot-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talentlessguy%2Ftelegram-bot-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/talentlessguy","download_url":"https://codeload.github.com/talentlessguy/telegram-bot-stats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248977056,"owners_count":21192517,"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":["telegram","telegram-bots"],"created_at":"2024-10-01T08:31:16.251Z","updated_at":"2025-04-14T23:27:27.931Z","avatar_url":"https://github.com/talentlessguy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# telegram-bot-stats\n\nGo library for collecting usage stats of telegram bots.\n\nIt produces the following json file:\n\n```jsonc\n{\n  \"count\": 2,\n  \"ids\": [\"123\", \"456\"] // telegram user IDs\n}\n```\n\n## Install\n\n```sh\ngo get github.com/talentlessguy/telegram-bot-stats\n```\n\n## Examples\n\n### [telebot](https://github.com/tucnak/telebot)\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/joho/godotenv\"\n\ttb \"gopkg.in/tucnak/telebot.v2\"\n\tstats \"github.com/talentlessguy/telegram-bot-stats\"\n)\n\nfunc main() {\n\n\tb, err := tb.NewBot(tb.Settings{\n\t\tToken:  \"TOKEN\",\n\t\tPoller: \u0026tb.LongPoller{Timeout: 10 * time.Second},\n\t})\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tb.Handle(\"/start\", func(m *tb.Message) {\n\t\tstats.AddUserToStat(m)\n\t})\n\n\tb.Handle(\"/getstat\", func(m *tb.Message) {\n\n\t\tjson := stats.ParseStatJSON()\n\t\tout := \"User count: \" + strconv.Itoa(json.Count)\n\t\tb.Send(m.Sender, out)\n\t})\n\n\tb.Start()\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalentlessguy%2Ftelegram-bot-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftalentlessguy%2Ftelegram-bot-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalentlessguy%2Ftelegram-bot-stats/lists"}