{"id":26221695,"url":"https://github.com/alestackoverglow/telegram-sticker-maker-bot","last_synced_at":"2025-08-04T18:10:28.393Z","repository":{"id":278976066,"uuid":"937373368","full_name":"AlestackOverglow/telegram-sticker-maker-bot","owner":"AlestackOverglow","description":"Telegram bot that automatically process images and videos to meet Telegram's requirements for creating stickers and emojis","archived":false,"fork":false,"pushed_at":"2025-03-03T01:29:45.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T16:37:49.887Z","etag":null,"topics":["python","telegram","telegram-bot"],"latest_commit_sha":null,"homepage":"https://alestackoverglow.github.io/","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/AlestackOverglow.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-02-22T22:21:29.000Z","updated_at":"2025-03-03T01:29:48.000Z","dependencies_parsed_at":"2025-03-02T01:18:59.352Z","dependency_job_id":null,"html_url":"https://github.com/AlestackOverglow/telegram-sticker-maker-bot","commit_stats":null,"previous_names":["alestackoverglow/telegram-sticker-maker-bot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlestackOverglow/telegram-sticker-maker-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlestackOverglow%2Ftelegram-sticker-maker-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlestackOverglow%2Ftelegram-sticker-maker-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlestackOverglow%2Ftelegram-sticker-maker-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlestackOverglow%2Ftelegram-sticker-maker-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlestackOverglow","download_url":"https://codeload.github.com/AlestackOverglow/telegram-sticker-maker-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlestackOverglow%2Ftelegram-sticker-maker-bot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268739763,"owners_count":24299752,"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-04T02:00:09.867Z","response_time":79,"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":["python","telegram","telegram-bot"],"created_at":"2025-03-12T16:29:12.815Z","updated_at":"2025-08-04T18:10:28.355Z","avatar_url":"https://github.com/AlestackOverglow.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram Sticker Maker Bot\r\n\r\nA Telegram bot that automatically process images and videos to meet Telegram's requirements for creating stickers and emojis in @Stickers. The bot maintains aspect ratios while resizing media to the correct dimensions and handles format conversion automatically.\r\n\r\nThis bot is designed with a session-based workflow: after choosing between sticker or emoji creation mode, it will continue processing all incoming media files in that mode until the user explicitly returns to the mode selection menu. This allows for efficient batch processing of multiple files without having to repeatedly select the desired output type.\r\n\r\nIf you find this project helpful, please consider giving it a star ⭐ It helps others discover the project and motivates further development.\r\n\r\n## Branches\r\nThe bot has two versions available in different branches:\r\n- `main` - Uses polling method to receive updates (recommended for development and testing)\r\n- `webhook-version` - Uses webhook method to receive updates (recommended for production)\r\n\r\n### Polling vs Webhook\r\n- **Polling (main branch)**: \r\n  - Simpler to set up and debug\r\n  - Works without public IP/domain\r\n  - Suitable for development and testing\r\n  - Higher resource usage due to constant requests\r\n\r\n- **Webhook (webhook-version branch)**:\r\n  - More efficient resource usage\r\n  - Faster message processing\r\n  - Requires HTTPS and public IP/domain\r\n  - Better for production deployment\r\n  - Supports dynamic webhook URL configuration\r\n\r\nChoose the branch that best suits your needs before proceeding with installation.\r\n\r\n## Table of Contents\r\n- [Requirements](#requirements)\r\n- [Installation](#installation)\r\n- [Usage](#usage)\r\n- [Features](#features)\r\n- [Logging](#logging)\r\n- [Error Handling](#error-handling)\r\n- [Shutdown](#shutdown)\r\n- [Autostart on Linux](#autostart-on-linux)\r\n- [Contributing](#contributing)\r\n- [License](#license)\r\n\r\n## Requirements\r\n- Python 3.8+\r\n- OpenCV (for video processing)\r\n- Required Python packages (see requirements.txt)\r\n\r\n## Installation\r\n1. Clone the repository:\r\n```bash\r\ngit clone https://github.com/AlestackOverglow/telegram-sticker-maker-bot.git\r\ncd telegram-sticker-maker-bot\r\n```\r\n\r\n2. Create and activate virtual environment (recommended):\r\n```bash\r\npython -m venv venv\r\n# On Windows:\r\nvenv\\Scripts\\activate\r\n# On Linux/Mac:\r\nsource venv/bin/activate\r\n```\r\n\r\n3. Install dependencies:\r\n```bash\r\npip install -r requirements.txt\r\n```\r\n\r\n4. Create `.env` file with your bot token:\r\n```\r\nBOT_TOKEN=your_bot_token_here\r\n```\r\n\r\n## Usage\r\n1. Start the bot:\r\n```bash\r\npython main.py\r\n```\r\n\r\n2. In Telegram:\r\n   - Send `/start` to begin\r\n   - Choose between creating a sticker or emoji\r\n   - Send any supported media file\r\n   - The bot will continue processing files in the chosen mode\r\n   - Use \"Back to Start\" button to switch between sticker and emoji modes\r\n   - The bot will automatically process and return each file in the correct format\r\n\r\n## Features\r\n- Creates both stickers and emoji from images and videos\r\n- Supports various input formats:\r\n  - Images: JPG, JPEG, PNG, WEBP\r\n  - Videos: MP4, WEBM\r\n  - Animated: GIF\r\n- Automatically resizes media while maintaining aspect ratio\r\n- Converts to required formats:\r\n  - Static stickers: PNG (512x512px max, 512KB max)\r\n  - Animated stickers: WEBM with VP9 codec (512x512px max, 256KB max)\r\n  - Static emoji: PNG (100x100px max, 100KB max)\r\n  - Animated emoji: WEBM with VP9 codec (100x100px max, 100KB max)\r\n- Handles animated content:\r\n  - Limits duration to 3 seconds\r\n  - Sets frame rate to 30 FPS\r\n  - Automatically adjusts bitrate to meet size requirements\r\n- Simple button-based interface\r\n- Automatic cleanup of temporary files\r\n- Session-based workflow for efficient batch processing\r\n\r\n## Logging\r\nThe bot logs all operations to `logs/bot.log` with automatic log rotation:\r\n- Maximum log file size: 10MB\r\n- Keeps last 5 log files\r\n- Logs include timestamps and detailed processing information\r\n\r\n## Error Handling\r\n- Validates input file formats\r\n- Checks file sizes and dimensions\r\n- Provides detailed error messages\r\n- Logs all errors with full tracebacks for debugging\r\n\r\n## Shutdown\r\nThe bot can be safely stopped by pressing Ctrl+C. It will:\r\n- Complete any ongoing file processing\r\n- Clean up temporary files\r\n- Close all connections properly\r\n\r\n## Autostart on Linux\r\nTo run the bot as a service on Linux using systemd:\r\n\r\n1. Create a systemd service file:\r\n```bash\r\nsudo nano /etc/systemd/system/stickmaker.service\r\n```\r\n\r\n2. Add the following configuration (adjust paths according to your setup):\r\n```ini\r\n[Unit]\r\nDescription=Telegram Sticker Maker Bot\r\nAfter=network.target\r\n\r\n[Service]\r\nType=simple\r\nUser=your_username\r\nGroup=your_group\r\nWorkingDirectory=/path/to/telegram-sticker-maker-bot\r\nEnvironment=PATH=/path/to/telegram-sticker-maker-bot/venv/bin\r\nExecStart=/path/to/telegram-sticker-maker-bot/venv/bin/python main.py\r\nRestart=always\r\nRestartSec=10\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n```\r\n\r\n3. Enable and start the service:\r\n```bash\r\nsudo systemctl enable stickmaker\r\nsudo systemctl start stickmaker\r\n```\r\n\r\n4. Check service status:\r\n```bash\r\nsudo systemctl status stickmaker\r\n```\r\n\r\n5. View logs:\r\n```bash\r\n# Service logs\r\nsudo journalctl -u stickmaker -f\r\n\r\n# Bot logs\r\ntail -f /path/to/telegram-sticker-maker-bot/logs/bot.log\r\n```\r\n\r\n## Contributing\r\nFeel free to submit issues and pull requests.\r\n\r\n## License\r\n[MIT License](LICENSE) \r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falestackoverglow%2Ftelegram-sticker-maker-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falestackoverglow%2Ftelegram-sticker-maker-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falestackoverglow%2Ftelegram-sticker-maker-bot/lists"}