{"id":18686883,"url":"https://github.com/yakiyo/welpy","last_synced_at":"2025-04-12T05:07:45.695Z","repository":{"id":116855024,"uuid":"555691887","full_name":"Yakiyo/welpy","owner":"Yakiyo","description":"Generating dynamic welcome images with user avatars in Carl-bot's welcome messages.","archived":false,"fork":false,"pushed_at":"2023-04-10T16:51:35.000Z","size":1852,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T00:36:00.679Z","etag":null,"topics":["api","carl-bot","deta","deta-micros","deta-space","discord","welcome-card"],"latest_commit_sha":null,"homepage":"","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/Yakiyo.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":"2022-10-22T05:05:35.000Z","updated_at":"2023-04-10T16:55:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b25c23c-b5f9-43e9-be08-493a0e24abe5","html_url":"https://github.com/Yakiyo/welpy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yakiyo%2Fwelpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yakiyo%2Fwelpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yakiyo%2Fwelpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yakiyo%2Fwelpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yakiyo","download_url":"https://codeload.github.com/Yakiyo/welpy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248519543,"owners_count":21117761,"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":["api","carl-bot","deta","deta-micros","deta-space","discord","welcome-card"],"created_at":"2024-11-07T10:29:48.986Z","updated_at":"2025-04-12T05:07:45.674Z","avatar_url":"https://github.com/Yakiyo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welpy \u003ca href=\"https://github.com/Yakiyo/welpy\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/Yakiyo/welpy?style=social\"\u003e\u003c/a\u003e \n\nGenerating dynamic welcome images with user avatars in [Carl-bot](https://carl.gg)'s welcome messages.\n\nCarl bot is a great bot with tons of features, but it lacks the ability to generate welcome messages with a custom image with the user avatar. To resolve this issue in the [Tsurekano Discord Server](https://discord.gg/q2zDU5bGnh), I made a [custom bot](https://github.com/Yakiyo/Yume-bot) but with [Heroku](https://www.heroku.com) closing their free trial, the bot was shut down. So in response to that, I created welpy, a REST api with python and Pillow that generates dynamic images with user avatars.\nThis is only available for the Tsurekano Discord Server and since the image is hardcoded, I don't believe it can be used anywhere else anyway.\nFor self hosting please refer to [this](#self-hosting) section.\n\n## Usage\nMake a get request with a `id` param specifying the user's discord id\n\n`GET /img?id=012345678912345678`\n\n**Returns:** `image/png`\n\nOn any error, it just returns the base [empty image](./assets/welcome.jpg) since it is not possible to customize carl bot from the user end to handle errors.\n\n## Self-Hosting\nIts pretty straight forward and works in a simple manner. The entry point is [main.py](./main.py) where it handles the incoming http requests. On a `GET` request to the `img` endpoint, it takes the `id` param and fetches info from discord on that user (see [fetch.py](./fetch.py)). It then passes the user info to the image constructing function (at [image.py](./image.py)) and does required modifications and returns the image.\n\n### Steps\n1) [**Fork**](https://github.com/Yakiyo/welpy/fork) this repo.\n2) Replace [**welcome.png**](./assets/welcome.png) with your background image.\n3) With a bit of python knowledge, you can fiddle around with [**image.py**](./image.py) and make the image show up as you want. If you don't know enough python, you can use a image thats similar to the current image so that even if the avatar shows up in the same spot, it looks cool. Or just put some effort and learn python. Its pretty cool and you can flex to your friends.\n4) Create a file named `.env` and add a discord bot token, this is required for making requests to discord.\n```env\nDISCORD_TOKEN=your-token-here\n```\n5) The repo is configured to work with [Deta Space](https://deta.space). Read more on deploying to deta space [here](https://deta.space/docs/en/introduction/start)\n\n## Demo Usage\n```\nhttps://welpy-1-p4917091.deta.app/img?id=695307292815654963\n```\n\u003cimg width=\"500px\" src=\"https://welpy-1-p4917091.deta.app/img?id=695307292815654963\"\u003e\n\n\n## Author\n**welpy** © [Yakiyo](https://github.com/Yakiyo). Authored and maintained by Yakiyo.\n\nReleased under [MIT](https://opensource.org/licenses/MIT) License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyakiyo%2Fwelpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyakiyo%2Fwelpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyakiyo%2Fwelpy/lists"}