{"id":17866492,"url":"https://github.com/LightQuantumArchive/teloxide-listener","last_synced_at":"2025-03-21T07:31:45.347Z","repository":{"id":36976315,"uuid":"421481191","full_name":"LightQuantumArchive/teloxide-listener","owner":"LightQuantumArchive","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-13T04:19:23.000Z","size":254,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T19:22:02.791Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/LightQuantumArchive.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-26T15:29:42.000Z","updated_at":"2025-01-13T22:37:25.000Z","dependencies_parsed_at":"2023-11-13T05:31:57.195Z","dependency_job_id":"87eaaa23-de17-42a8-88e6-122034992190","html_url":"https://github.com/LightQuantumArchive/teloxide-listener","commit_stats":{"total_commits":116,"total_committers":2,"mean_commits":58.0,"dds":"0.23275862068965514","last_synced_commit":"3ec022edf3626fe7cdf51f48bb9233dfd98728b1"},"previous_names":["lightquantumarchive/teloxide-listener"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightQuantumArchive%2Fteloxide-listener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightQuantumArchive%2Fteloxide-listener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightQuantumArchive%2Fteloxide-listener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LightQuantumArchive%2Fteloxide-listener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LightQuantumArchive","download_url":"https://codeload.github.com/LightQuantumArchive/teloxide-listener/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244758048,"owners_count":20505567,"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-28T09:37:14.566Z","updated_at":"2025-03-21T07:31:45.065Z","avatar_url":"https://github.com/LightQuantumArchive.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# teloxide-listener\n\nA listener extension for [teloxide](https://github.com/teloxide/teloxide).\n\nCurrently supports the following modes:\n- `polling`\n- `webhook` (axum, need to be enabled by feature flag)\n\n## Usage\n\nConstruct a `Listener` builder, build it, and pass it to `with_listener` versions of teloxide functions (e.g., [`repl_with_listener`](teloxide::dispatching2::repls::repl_with_listener)).\n\nThere are two ways to construct a `Listener` builder.\n\n### From environment variables\n\n[`Listener::from_env`](Listener::from_env) can be used to construct a `Listener` from environment variables.\n\nIf compiled with `webhook` feature enabled, it tries to read `TELOXIDE_WEBHOOK_URL`, `TELOXIDE_WEBHOOK_PATH`, and `TELOXIDE_BIND_ADDR` to build a webhook updates listener first.\n\nOtherwise, it falls back to long polling updates listener.\n\nTo customize the `TELOXIDE_` prefix, use [`Listener::from_env_with_prefix`](Listener::from_env_with_prefix).\n\n### Constructing a `Listener` manually\n\n- [`Listener::Polling`](Listener::Polling) - a long polling updates listener.\n- [`Listener::Webhook`](Listener::Webhook) - a webhook updates listener.\n\n## Example\n\n```rust\nuse teloxide_listener::Listener;\n\nlet listener = Listener::from_env().build(bot.clone());\n\nteloxide::repls2::repl_with_listener(\n    bot,\n    |msg: Message, bot: Bot| async move {\n        bot.send_message(msg.chat.id, \"pong\").send().await?;\n        respond(())\n    },\n    listener,\n)\n```\n\n## License\n\nThis project is licensed under the [MIT license](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLightQuantumArchive%2Fteloxide-listener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLightQuantumArchive%2Fteloxide-listener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLightQuantumArchive%2Fteloxide-listener/lists"}