{"id":16486051,"url":"https://github.com/roziscoding/grammy-api","last_synced_at":"2025-02-28T23:47:41.032Z","repository":{"id":195081305,"uuid":"692185274","full_name":"roziscoding/grammy-api","owner":"roziscoding","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-30T12:49:23.000Z","size":59,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T02:55:47.316Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/roziscoding.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-15T18:52:57.000Z","updated_at":"2023-11-29T21:52:33.000Z","dependencies_parsed_at":"2024-11-12T15:37:20.174Z","dependency_job_id":"4193b235-4696-4a75-bedf-ba2a0de40327","html_url":"https://github.com/roziscoding/grammy-api","commit_stats":null,"previous_names":["roziscoding/grammy-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fgrammy-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fgrammy-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fgrammy-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fgrammy-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roziscoding","download_url":"https://codeload.github.com/roziscoding/grammy-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241279339,"owners_count":19938083,"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":[],"created_at":"2024-10-11T13:28:12.791Z","updated_at":"2025-02-28T23:47:41.009Z","avatar_url":"https://github.com/roziscoding.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grammY API\n\nBroadcasting made easy for grammY users.\n\n# Running\n\n- `git clone git@github.com/roziscoding/grammy-api.git`\n- `cd grammy-api`\n- `docker compose up`\n\nThe API listens on port 3000.\n\n# Endpoints\n\nAll endpoints expect a `grammy-token` header to be present, which is the token of your bot. All communication is done\nthrough JSON (application/json content-type). All endpoints return an object with `{ \"ok\": true }` on success.\n\n## POST /setWebhook\n\nExpects a `webhookUrl` string property on the body. Sets that URL as broadcast webhook for your bot. You must call this\nendpoint at least once before calling any other one.\n\nExample (httpie):\n\n```sh\nhttpie POST :3000/setWebhook \\\ngrammy-token:298456616:AAFR6AuHgCvYuknZNsvqp724soFrSsPDRBE \\\nwebhookUrl=\"http://localhost:3030\"\n```\n\nResponse\n\n```json\n{\n  \"ok\": true,\n  \"message\": \"webhook successfully set for token grammy-token:298456616:AAFR6AuHgCvYuknZNsvqp724soFrSsPDRBE\"\n}\n```\n\n## POST /chatMember\n\nExpects a [`ChatMemberUpdated`](https://core.telegram.org/bots/api#chatmemberupdated) object from the Telegram API. If\nyou use the grammY plugin (comming soon™️) you shouldn't need to call this manually.\n\n## POST /broadcast\n\nExpects a `chatTypes` parameter containing an array of allowed [`Chat`](https://core.telegram.org/bots/api#chat) types\nthat you want to include on the broadcast. Reads the IDs from the chats stored previously by your bot and queues jobs to\ncall your webhook once per ID.\n\nExample (httpie):\n\n```sh\nhttpie POST :3000/broadcast \\\ngrammy-token:298456616:AAFR6AuHgCvYuknZNsvqp724soFrSsPDRBE \\\n'chatTypes[]=group'\n```\n\nResponse\n\n```json\n{\n  \"ok\": true,\n  \"broadcast\": {\n    \"id\": 2,\n    \"lastFinishedId\": 0,\n    \"status\": \"idle\",\n    \"lastErrorBody\": \"\",\n    \"createdAt\": \"2023-09-15T19:34:07.004Z\",\n    \"startedAt\": null,\n    \"finishedAt\": null,\n    \"botId\": 1,\n    \"ids\": 1\n  }\n}\n```\n\n## GET /broadcasts\n\nReturns a list of existing broadcasts for your bot.\n\nExample (httpie)\n\n```sh\nhttpie :3000/broadcasts \\\ngrammy-token:298456616:AAFR6AuHgCvYuknZNsvqp724soFrSsPDRBE\n```\n\nResponse:\n\n```json\n[\n  {\n    \"id\": 1,\n    \"lastFinishedId\": 0,\n    \"status\": \"error\",\n    \"lastErrorBody\": \"TypeError: error sending request for url (http://localhost:3030/): error trying to connect: tcp connect error: Connection refused (os error 111)\",\n    \"createdAt\": \"2023-09-15T23:19:46.681Z\",\n    \"startedAt\": \"2023-09-15T23:19:46.737Z\",\n    \"finishedAt\": null\n  }\n]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froziscoding%2Fgrammy-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froziscoding%2Fgrammy-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froziscoding%2Fgrammy-api/lists"}