{"id":27072797,"url":"https://github.com/hong539/sauce-man","last_synced_at":"2025-04-05T23:33:51.299Z","repository":{"id":161894491,"uuid":"636524993","full_name":"hong539/sauce-man","owner":"hong539","description":"sauce-man is a discord bot to make discord UI/UX better!","archived":false,"fork":false,"pushed_at":"2025-03-26T09:46:06.000Z","size":543,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T10:33:02.912Z","etag":null,"topics":["backend","backend-api","backend-app","backend-development","container","discord-bot","docker","dockerfile","fastapi","python","python3","search-algorithm","search-engine","uv"],"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/hong539.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":"2023-05-05T03:33:44.000Z","updated_at":"2025-03-26T09:46:10.000Z","dependencies_parsed_at":"2023-05-23T03:00:31.988Z","dependency_job_id":"a4407117-0730-4a0c-b7ac-5fe89c6d9ddd","html_url":"https://github.com/hong539/sauce-man","commit_stats":null,"previous_names":["hong539/sauce-man","hong539/sauce_man"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hong539%2Fsauce-man","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hong539%2Fsauce-man/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hong539%2Fsauce-man/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hong539%2Fsauce-man/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hong539","download_url":"https://codeload.github.com/hong539/sauce-man/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415825,"owners_count":20935384,"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":["backend","backend-api","backend-app","backend-development","container","discord-bot","docker","dockerfile","fastapi","python","python3","search-algorithm","search-engine","uv"],"created_at":"2025-04-05T23:33:50.921Z","updated_at":"2025-04-05T23:33:51.293Z","avatar_url":"https://github.com/hong539.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sauce-man\n\n* sauce-man is services which includes:\n    * bot: a discord bot to make discord app bertter to:        \n        * Fix Links Previews\n        * reverse image search\n    * api: a FastAPI to interact with bot\n    * cms: matain bots via api\n\n## To-do-list\n\n### working\n\n* uv\n```shell\nuv pip freeze --project pyproject.toml\n#vs\nuv pip compile pyproject.toml \u003e requirements.txt\n```\n* refactoring\n    * ~~move src/** to backend/**~~\n    * ~~merge backend/core/settings.py to backend/bot/config.py~~\n    ~~* ~/sauce-man$ uv run backend/bot/main.py~~\n        ~~* ModuleNotFoundError: No module named 'core'~~\n    ~~* ~/sauce-man$ python3 backend/bot/main.py~~\n        ~~* ModuleNotFoundError: No module named 'discord'~~\n* update Dockerfile\n* ~~migrage from pyenv+poetry to uv~~\n* test discord.py\n* ~~find a better and safe way to set env~~\n    * pydantic-settings\n* implement event handling\n    * Discord Twitter Link Handler\u003cbr\u003e\n        ✅ Detect Twitter links in messages\u003cbr\u003e\n        ✅ Extract Tweet ID from the URL\u003cbr\u003e\n        ✅ Fetch tweet data using fxtwitter API (fallback to vxtwitter API)\u003cbr\u003e\n        ✅ Generate a Discord Embed containing tweet details\u003cbr\u003e\n        ✅ Send tweet media (images/videos) separately\u003cbr\u003e\n        ✅ Provide a backup link if API calls fail\u003cbr\u003e\n        ✅ Suppress Discord’s default Twitter preview\u003cbr\u003e\n* implement channel app commands\n    * ~~search history messages from a specific channel~~\n    * dump history messages from a specific channel\n        * calculate the range \u003c= 100 for iterator to append all history to the stored list\n\n### pending\n\n* Container part\n    * ~~prepare Dockerfile~~\n    * ~~Run with podman~~\n    * docekr network DNS resovle error\n        * ERROR: failed to solve: docker.io/python:3.11.4-slim-bullseye: failed to do request: Head \"https://registry-1.docker.io/v2/library/python/manifests/3.11.4-slim-bullseye\": EOF\n\n### done\n\n* ~~separate function load_config from class or not? (Hint: Like django settings.py)~~\n* ~~postgresql db init~~\n\n## quick-start\n\n```shell\n#backend\n#discord-bot\nuv run backend/manage.py runbot --uv\n# uv run --python=python3.10 backend/manage.py runbot --uv\n\n#FastAPI\nuv run --python=python3.10 backend/manage.py runapi 0.0.0.0 8000 --uv\n\n#setting up \nbash scripts/uv_tools.sh\n\n#build docker container image\ndocker build . -t docker.io/focal1119/sauce-man:test\n\n#run container with docker run\ndocker run -d --env-file=backend/core/.env --name sauce-man docker.io/focal1119/sauce-man-bot:2025-02-27-15-57\n\n#run with docker compose\n#up and run in background\ndocker compose up -d\n\n#down\ndocker compose down\n\n#podman container build/run\npodman build . -t docker.io/focal1119/sauce-man:test\npodman build . --no-cache -t docker.io/focal1119/sauce-man:test\npodman run -d --env-file=.env --name sauce-man docker.io/focal1119/sauce-man:test\n```\n\n## misc\n\n### Reference implementation\n\n* [ermiana](https://github.com/canaria3406/ermiana/tree/master)\n    * A Discord bot that fixes sites with broken preview by providing more detailed images and webpage content. Supports multiple popular sites in Taiwan, East Asia. \n* [bckbot](https://github.com/hker9527/bckbot)\n    * A discord bot powered by discord.js \n* [how-do-i-apply-environment-variables-to-python-interactive](https://stackoverflow.com/questions/73858371/how-do-i-apply-environment-variables-to-python-interactive)\n* [pprint](https://docs.python.org/3.11/library/pprint.html)\n* [os.environ](https://docs.python.org/3/library/os.html#os.environ)\n* [sqlalchemy/postgresql](https://docs.sqlalchemy.org/en/20/dialects/postgresql.html)\n* [pandas](https://pandas.pydata.org/)\n* [decorator](https://docs.python.org/3/glossary.html#term-decorator)\n* [await fetch_message](https://discordpy.readthedocs.io/en/latest/api.html#discord.TextChannel.fetch_message)\n* [read_message_history](https://discordpy.readthedocs.io/en/latest/api.html?highlight=history#discord.Permissions.read_message_history)\n* [async for ... in history](https://discordpy.readthedocs.io/en/latest/api.html?highlight=history#discord.User.history)\n* [discord.py/examples/](https://github.com/Rapptz/discord.py/tree/master/examples)\n* [How to retrieve previous messages with discord.py](https://stackoverflow.com/questions/64995479/how-to-retrieve-previous-messages-with-discord-py)\n* [How could I grab all chat messages in a specific channel in a discord server using discord.py?](https://stackoverflow.com/questions/64211658/how-could-i-grab-all-chat-messages-in-a-specific-channel-in-a-discord-server-usi)\n* [Community Resources](https://discord.com/developers/docs/topics/community-resources#community-resources)\n* [discord.com/developers/docs/getting-started](https://discord.com/developers/docs/getting-started)\n* [Discord bot that automatically download images from a channel.](https://www.reddit.com/r/Discord_Bots/comments/pdz8kp/discord_bot_that_automatically_download_images/)\n    * [d-logger.py](https://github.com/therealOri/d-logger/blob/main/d-logger.py)\n* [discord.py/intro](https://discordpy.readthedocs.io/en/latest/intro.html)\n* [events](https://discordpy.readthedocs.io/en/latest/api.html#event-reference)\n    * [coroutine](https://docs.python.org/3/library/asyncio-task.html#coroutine)\n        * [asyncio](https://docs.python.org/3.8/library/asyncio.html)\n\n## Important!!!\n\n== We're Using GitHub Under Protest ==\n\nThis project is currently hosted on GitHub.  This is not ideal; GitHub is a\nproprietary, trade-secret system that is not Free and Open Souce Software\n(FOSS).  We are deeply concerned about using a proprietary system like GitHub\nto develop our FOSS project.  We have an\n[open {bug ticket, mailing list thread, etc.} ](INSERT_LINK) where the\nproject contributors are actively discussing how we can move away from GitHub\nin the long term.  We urge you to read about the\n[Give up GitHub](https://GiveUpGitHub.org) campaign from\n[the Software Freedom Conservancy](https://sfconservancy.org) to understand\nsome of the reasons why GitHub is not a good place to host FOSS projects.\n\nIf you are a contributor who personally has already quit using GitHub, please\n[check this resource](INSERT_LINK) for how to send us contributions without\nusing GitHub directly.\n\nAny use of this project's code by GitHub Copilot, past or present, is done\nwithout our permission.  We do not consent to GitHub's use of this project's\ncode in Copilot.\n\n![Logo of the GiveUpGitHub campaign](https://sfconservancy.org/img/GiveUpGitHub.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhong539%2Fsauce-man","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhong539%2Fsauce-man","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhong539%2Fsauce-man/lists"}