{"id":24534645,"url":"https://github.com/aboldev/codesnap-bot","last_synced_at":"2025-08-13T23:04:38.958Z","repository":{"id":272138061,"uuid":"915634751","full_name":"AbolDev/CodeSnap-bot","owner":"AbolDev","description":"A Telegram bot that converts code snippets into beautifully highlighted images with customizable themes and fonts.","archived":false,"fork":false,"pushed_at":"2025-01-12T12:02:02.000Z","size":124,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T22:26:23.168Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/AbolDev.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":"2025-01-12T11:59:38.000Z","updated_at":"2025-01-15T12:11:57.000Z","dependencies_parsed_at":"2025-01-12T13:18:34.969Z","dependency_job_id":"fea55fc2-d4ce-46a0-b2d7-44bec95a77eb","html_url":"https://github.com/AbolDev/CodeSnap-bot","commit_stats":null,"previous_names":["aboldev/codesnap-bot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AbolDev/CodeSnap-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbolDev%2FCodeSnap-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbolDev%2FCodeSnap-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbolDev%2FCodeSnap-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbolDev%2FCodeSnap-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AbolDev","download_url":"https://codeload.github.com/AbolDev/CodeSnap-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbolDev%2FCodeSnap-bot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270330595,"owners_count":24565816,"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-13T02:00:09.904Z","response_time":66,"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":[],"created_at":"2025-01-22T11:18:11.342Z","updated_at":"2025-08-13T23:04:38.909Z","avatar_url":"https://github.com/AbolDev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeSnap-bot\r\n\r\nA Telegram bot that converts code snippets into beautifully formatted images with syntax highlighting. Perfect for sharing code in an elegant way!\r\n\r\n## Features\r\n\r\n- Syntax highlighting for various programming languages.\r\n- Multiple color themes for image styling (default: `nord-darker`).\r\n- Line numbers with customizable background and foreground colors.\r\n- Supports direct messages and group mentions.\r\n- Processes code blocks in replies or messages with `pre` tags.\r\n\r\n## Requirements\r\n\r\nThis bot requires the following Python libraries:\r\n\r\n- [pyTelegramBotAPI](https://pypi.org/project/pyTelegramBotAPI)\r\n- [Pygments](https://pypi.org/project/Pygments/)\r\n- [Pillow](https://pypi.org/project/Pillow/)\r\n\r\nInstall all dependencies with:\r\n\r\n```bash\r\npip install -r requirements.txt\r\n```\r\n\r\n## Installation\r\n\r\n1. Clone this repository:\r\n    ```bash\r\n    git clone https://github.com/AbolDev/CodeSnap-bot.git\r\n    cd CodeSnap-bot\r\n    ```\r\n\r\n2. Install the dependencies:\r\n    ```bash\r\n    pip install -r requirements.txt\r\n    ```\r\n\r\n3. Create a `config.py` file with your bot's token:\r\n    ```python\r\n    # config.py\r\n    TOKEN = 'YOUR_BOT_TOKEN_HERE'\r\n    ```\r\n\r\n4. Run the bot:\r\n    ```bash\r\n    python bot.py\r\n    ```\r\n\r\n5. The bot will start running and listening for messages.\r\n\r\n## Usage\r\n\r\n1. **Start the Bot:** Send the `/start` command to the bot.\r\n2. **Send Code:** \r\n   - Directly send a code snippet.\r\n   - Reply to a message containing a code block.\r\n   - Mention the bot in a group and include the code snippet.\r\n\r\nThe bot will process the code and reply with a syntax-highlighted image.\r\n\r\n## Example Themes\r\n\r\nYou can switch the theme in the `generate_code_image` function. Some available themes:\r\n- `dracula`\r\n- `github-dark`\r\n- `gruvbox-dark`\r\n- `monokai`\r\n- `nord-darker`\r\n- `one-dark`\r\n- `solarized-dark`\r\n- `paraiso-dark`\r\n\r\n## Example Screenshot\r\n\r\n![Example Output](assets/example-output.png)\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Feel free to open issues or submit pull requests for improvements or bug fixes.\r\n\r\n## Support\r\n\r\nIf you encounter any issues or have questions, please open an issue in the GitHub repository or contact me directly.\r\n\r\n---\r\nHappy coding! 🚀\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faboldev%2Fcodesnap-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faboldev%2Fcodesnap-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faboldev%2Fcodesnap-bot/lists"}