{"id":15107911,"url":"https://github.com/valnesfjord/vtg","last_synced_at":"2025-08-28T17:09:32.762Z","repository":{"id":231911411,"uuid":"683673355","full_name":"valnesfjord/vtg","owner":"valnesfjord","description":"VTG is a fully functional library for creating bots for both VK and Telegram.","archived":false,"fork":false,"pushed_at":"2025-02-23T15:33:51.000Z","size":4311,"stargazers_count":10,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-15T07:33:40.941Z","etag":null,"topics":["bots","rust","telegram","telegram-bot-api","vk","vk-api","vtg"],"latest_commit_sha":null,"homepage":"","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/valnesfjord.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":"2023-08-27T10:42:02.000Z","updated_at":"2025-04-23T21:51:48.000Z","dependencies_parsed_at":"2024-04-27T08:22:33.407Z","dependency_job_id":"a2530ffe-58de-429d-8322-599713583a58","html_url":"https://github.com/valnesfjord/vtg","commit_stats":{"total_commits":82,"total_committers":2,"mean_commits":41.0,"dds":0.2804878048780488,"last_synced_commit":"6d18bf5a60a2705e22fe65c5e7e689fe0596cf4e"},"previous_names":["valnesfjord/vtg"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/valnesfjord/vtg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valnesfjord%2Fvtg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valnesfjord%2Fvtg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valnesfjord%2Fvtg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valnesfjord%2Fvtg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valnesfjord","download_url":"https://codeload.github.com/valnesfjord/vtg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valnesfjord%2Fvtg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272526724,"owners_count":24949836,"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","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bots","rust","telegram","telegram-bot-api","vk","vk-api","vtg"],"created_at":"2024-09-25T21:42:54.120Z","updated_at":"2025-08-28T17:09:32.723Z","avatar_url":"https://github.com/valnesfjord.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VTG - dual-platform bots library\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/valnesfjord/vtg/raw/HEAD/vtg.jpeg\" width=\"200\"\u003e\n\u003c/p\u003e\nVTG is a fully functional library for creating bots for both VK and Telegram. Presents unified context and methods, for comfortable work with dual-platform bots.\n\n## Features\n\n-   Support callback and longpoll updates\n-   90% VK and TG API coverage (messages)\n-   Unified context for both platforms\n-   Unified context methods for both platforms\n-   Unified attachments and file uploads for both platforms\n-   Unified keyboard for both platforms\n-   Easy to use\n-   Easy to understand\n-   Easy to contribute\n\n## Usage\n\nExample using longpoll client:\n\n```rust\nuse std::env;\n\nuse vtg::{\n    client::start_longpoll_client,\n    structs::{config::Config, context::UnifyedContext, middleware::MiddlewareChain},\n};\n\nasync fn catch_new_message(ctx: UnifyedContext) -\u003e UnifyedContext {\n    ctx\n}\n\n#[tokio::main]\nasync fn main() {\n    let config = Config {\n        vk_access_token: env::var(\"VK_ACCESS_TOKEN\").unwrap(),\n        vk_group_id: env::var(\"VK_GROUP_ID\").unwrap().parse().unwrap(),\n        tg_access_token: env::var(\"TG_ACCESS_TOKEN\").unwrap(), // token starts with \"bot\", like: bot1234567890:ABCDEFGHIJKL\n        ..Default::default()\n    };\n\n    let mut middleware_chain = MiddlewareChain::new();\n    middleware_chain.add_middleware(|ctx| Box::pin(catch_new_message(ctx)));\n\n    start_longpoll_client(middleware_chain, config).await;\n}\n\n```\n\nExample using callback server:\n\n```rust\nuse std::env;\n\nuse vtg::{\n    server::start_callback_server,\n    structs::{\n        config::{CallbackSettings, Config},\n        context::UnifyedContext,\n        middleware::MiddlewareChain,\n    },\n};\n\nasync fn catch_new_message(ctx: UnifyedContext) -\u003e UnifyedContext {\n    ctx\n}\n\n#[tokio::main]\nasync fn main() {\n    let config = Config {\n        vk_access_token: env::var(\"VK_ACCESS_TOKEN\").unwrap(),\n        vk_group_id: env::var(\"VK_GROUP_ID\").unwrap().parse().unwrap(),\n        tg_access_token: env::var(\"TG_ACCESS_TOKEN\").unwrap(), // token starts with \"bot\", like: bot1234567890:ABCDEFGHIJKL\n        vk_api_version: \"5.199\".to_owned(),\n        callback: Some(CallbackSettings {\n            port: 1234,\n            callback_url: \"https://valnesfjord.com\".to_string(),\n            secret: \"secret\".to_string(),\n            path: \"yourcallbacksecretpathwithoutslashinstartandend\".to_string(),\n        }),\n    };\n\n    let mut middleware_chain = MiddlewareChain::new();\n    middleware_chain.add_middleware(|ctx| Box::pin(catch_new_message(ctx)));\n\n    start_callback_server(middleware_chain, config).await;\n}\n```\n\n## Examples\n\nYou can find example bot in the [examples folder](https://github.com/valnesfjord/vtg/tree/master/examples)\n\n## Try bot, that works with vtg\n\nYou can try test bot, that works in actual version of vtg: [tg](https://t.me/deformation_bot), [vk](https://vk.me/deformation_bot)\n\n## Documentation\n\nYou can find the documentation [here](https://docs.rs/vtg)\n\n## It's not finished yet:\n\n-   [ ] Add more tests\n-   [ ] Add more examples\n-   [ ] Add VK and TG API documentation\n-   [ ] Add more features (like more API coverage, etc)\n\n## Contact the maintainer\n\nTelegram: @valnesfjord Discord: valnesfjord VK: https://vk.com/cyournamec\n\n## [Discussion](https://t.me/vtglib)\n\n## Contribution\n\nContributions are always welcome! If you have any ideas, suggestions, or issues, feel free to contribute. You can fork the repository and create a pull request with your changes, or create an issue if you find any bugs or have suggestions for improvements.\n\nWe appreciate your help in making this project better!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalnesfjord%2Fvtg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalnesfjord%2Fvtg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalnesfjord%2Fvtg/lists"}