Telegram Bot: Sticker Optimizer

January 29, 2025 ยท View on GitHub

logo

Telegram Bot: Sticker Optimizer

link status link link GitHub

Optimize an image or sticker to a png file to make its size smaller than or equal to 512Kb, so that you will be able to add it to a sticker pack using the @stickers bot.

๐Ÿ›  Built with

  • Programming language: PHP
  • Language framework: Laravel
  • Bot framework: Nutgram

๐Ÿ›ก Requirements

  • Apache / nginx
  • SSL support
  • PHP โ‰ฅ 8.4
    • ext-json
    • ext-pdo
    • ext-gd
    • webp support
  • Imagick
  • MariaDB โ‰ฅ 10.2.3 or Postgresql โ‰ฅ 9.5 or SQLite with JSON1 extension
  • SystemD (to process async jobs)
  • Crontab (to update cached statistics)
  • GIT

๐Ÿ—ƒ๏ธ Flow chart

flow

๐Ÿš€ First deploy

  1. cd <vhost-folder>
  2. git clone https://github.com/<username>/telegram-stickeroptimizer.git
  3. cd telegram-stickeroptimizer
  4. php artisan migrate
  5. cp .env.example .env
  6. Edit the .env file with your preferences
  7. wget https://getcomposer.org/download/latest-2.x/composer.phar
  8. php composer.phar install
  9. sudo chmod -R 775 bootstrap/
  10. sudo chmod -R 775 storage/
  11. php artisan storage:link
  12. Create a new cron: * * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
  13. Configure a SystemD Unit to execute: php artisan queue:work --queue=news --memory=512
  14. php artisan nutgram:register-commands
  15. php artisan nutgram:hook:set https://<domain>.<tls>/hook

๐ŸŒ  Continuous deployment

This project will be updated in production at every pushed tag to master branch.
Check this github workflow: deploy.yml

โ˜‘ TODO List

Check the Projects page.

๐Ÿ“ƒ Changelog

Please see the changelog.md for more information on what has changed recently.

๐Ÿ… Credits

๐Ÿ“– License

Please see the LICENSE.md file for more information.