{"id":18284263,"url":"https://github.com/openshot/thumbnail-discord-bot","last_synced_at":"2025-04-12T07:25:39.133Z","repository":{"id":225079276,"uuid":"765003772","full_name":"OpenShot/thumbnail-discord-bot","owner":"OpenShot","description":"Discord bot that generates \u0026 shares collages of new pixel-art image assets in git, streamlining the review process for creative teams","archived":false,"fork":false,"pushed_at":"2024-02-29T05:20:31.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T02:42:39.787Z","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/OpenShot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2024-02-29T05:16:43.000Z","updated_at":"2024-10-11T23:20:22.000Z","dependencies_parsed_at":"2024-02-29T06:27:52.603Z","dependency_job_id":null,"html_url":"https://github.com/OpenShot/thumbnail-discord-bot","commit_stats":null,"previous_names":["openshot/thumbnail-discord-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenShot%2Fthumbnail-discord-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenShot%2Fthumbnail-discord-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenShot%2Fthumbnail-discord-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenShot%2Fthumbnail-discord-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenShot","download_url":"https://codeload.github.com/OpenShot/thumbnail-discord-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248532332,"owners_count":21119898,"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-11-05T13:12:52.489Z","updated_at":"2025-04-12T07:25:39.109Z","avatar_url":"https://github.com/OpenShot.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Thumbnail (Discord Bot)\n\nThis open-source utility scans through local Git repositories to find recently added images in `png` and `tga` formats, \ngenerating thumbnail collages for each **git author** and **repository** combination. These collages are then \nautomatically posted to a specified **Discord channel**, providing an easy way to visually track \u0026 share new \nimage assets across multiple projects.\n\n## Pixel Art \u0026 Team Collaboration\n\n**Transform your team's art review process!** Instantly share and discuss new textures, UI designs, \nand game assets in **Discord** with automatically generated collages. Engage with reactions, comments, quotes, \nand easily collaborate with your team. Make asset reviews a breeze and supercharge your project's development!\n\nThis script is optimized for **pixel art**, scaling images without aliasing to preserve the pixel-perfect \nclarity essential for reviewing detailed pixel art assets. It compiles these up-scaled images into a \ncollage for easy review and analysis of multiple assets.\n\n## Screenshot\n\n![Thumbnail Collage Example](thumbnail.png \"Example of a generated thumbnail collage\")\n\n## Structure\n\nThe project consists of the following key components:\n\n- `README.md`: This file, containing instructions for setup and usage.\n- `LICENSE.md`: The MIT License under which this project is distributed.\n- `thumbnail-bot.py`: The main Python script that generates thumbnail collages.\n- `thumbnail-commits.json`: Tracks the most recent thumbnailed commit SHAs to avoid duplication.\n- `thumbnail.png`: The most recent collage image generated by the script.\n- `git-refresh.sh`: A shell script to clone and update local copies of the repositories.\n- `*.log`: Log files created by the scripts upon execution.\n- `/repo1`, `/repo2`, `/repo3`: Example repository folders that would be scanned by the script.\n\n## Installation Instructions\n\n### System Requirements\n\nThis script has been tested on **Ubuntu 20.04+**, and requires `python 3`, `bash`, `ssh`, and `cron` scheduling.\nIt also requires creating a custom Discord App, Bot User, and generating a Bot Token.\n\n### Setup\n\n1. **Create a directory for Git Thumbnails:**\n\n   ```bash\n   mkdir GitThumbnails\n   cd GitThumbnails\n   ```\n\n1. Install required Python modules:\n\n   ```bash\n   python3 -m pip install -r requirements.txt\n   ```\n\n1. Prepare the `git-refresh.sh` script:\n   \n   Edit the list of local git `repositories` for the script to clone and pull. Also, set up the private key for \n   `GIT_SSH_COMMAND` for cron scheduling. These 2 settings are found in the `git-refresh.sh` file.\n   \n   ```bash\n   nano git-refresh.sh\n   ```\n\n1. Test \u0026 Clone the repositories\n\n   After editing, grant execute permission to the `git-refresh.sh` file and run it to clone and update repositories.\n   Verify that all local repos are cloned correctly and no errors are output.\n\n   ```bash\n   chmod +x git-refresh.sh\n   ./git-refresh.sh\n   ```\n\n1. Prepare the `thumbnail-bot.py` script:\n\n   Edit the `thumbnail-bot.py` script and enter your own, custom Discord Bot **Token**. You will need to visit\n   the **Discord Developer Portal**, create a new Application, generate a bot user, and generate a token.\n\n   ```bash\n   nano thumbnail-bot.py\n   # TOKEN = \"ENTER-YOUR-DISCORD-BOT-TOKEN-HERE\"\n   ```\n   \n### Usage\n\n1. Run the Thumbnail Bot:\n\n   Execute `thumbnail-bot.py` with a `Discord channel ID` as an argument. This will generate and post thumbnail collages \n   for all repositories. NOTE: The **first time** you run this command, it will attempt to iterate through **all commits**\n   in your repos, generating 1 collage per author, per project. In other words, it will be **very slow** on the first run.\n   Future runs will be extremely quick, since we keep track of the last `SHA` thumbnailed for each repo.\n\n   ```bash\n   python3 thumbnail-bot.py \u003cdiscord_channel_id\u003e\n   ```\n\n1. Schedule Automatic Updates:\n\n   Use `crontab -e` to add cron jobs for automatically refreshing repository clones and generating new thumbnails.\n\n   ```bash\n   # Refresh repos every hour at minute 0\n   0 */1 * * * cd \"/path/to/GitThumbnails/\" \u0026\u0026 ./git-refresh.sh \u003e\u003e git-refresh.log 2\u003e\u00261\n   \n   # Generate and post thumbnails every hour at minute 5\n   5 */1 * * * cd \"/path/to/GitThumbnails/\" \u0026\u0026 python3 thumbnail-bot.py \u003cdiscord_channel_id\u003e \u003e\u003e thumbnail-bot.log 2\u003e\u00261\n   ```\n\n   Replace `/path/to/GitThumbnails/` and `\u003cdiscord_channel_id\u003e` with your actual directory path and Discord channel ID, respectively.\n\n## License\n\n### Copyright (c) 2024 OpenShot Studios, LLC\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n\n## Support \u0026 Contributing\n\nWe welcome contributions from the community and are excited to see how the project grows and evolves with your input. \nWhether you're reporting a bug, suggesting enhancements, or submitting a pull request, every contribution is valued.\n\n### Support\n\nAs an open-source project, we provide support on a volunteer basis. We prioritize a welcoming and respectful environment, \nand while we strive to address issues and questions promptly, there might be delays. Your understanding and patience \nare greatly appreciated.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenshot%2Fthumbnail-discord-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenshot%2Fthumbnail-discord-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenshot%2Fthumbnail-discord-bot/lists"}