{"id":15984066,"url":"https://github.com/blacksmithop/mafiaggbot","last_synced_at":"2025-07-11T16:13:17.621Z","repository":{"id":112175668,"uuid":"367794727","full_name":"blacksmithop/MafiaggBot","owner":"blacksmithop","description":"Mafia.gg Bot","archived":false,"fork":false,"pushed_at":"2024-12-20T11:09:57.000Z","size":1504,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-08T10:06:12.970Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://mafia.abhinavkm.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blacksmithop.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-05-16T05:42:41.000Z","updated_at":"2025-03-19T08:15:51.000Z","dependencies_parsed_at":"2024-01-13T17:32:35.496Z","dependency_job_id":"fd0180ac-0e47-46f0-9b36-a4aecacfddf7","html_url":"https://github.com/blacksmithop/MafiaggBot","commit_stats":{"total_commits":149,"total_committers":4,"mean_commits":37.25,"dds":0.5503355704697986,"last_synced_commit":"3b36e4e2db8f0fe17481dd86b01821b38a121f1a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/blacksmithop/MafiaggBot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacksmithop%2FMafiaggBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacksmithop%2FMafiaggBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacksmithop%2FMafiaggBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacksmithop%2FMafiaggBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blacksmithop","download_url":"https://codeload.github.com/blacksmithop/MafiaggBot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacksmithop%2FMafiaggBot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264850809,"owners_count":23673232,"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-10-08T02:04:25.705Z","updated_at":"2025-07-11T16:13:17.570Z","avatar_url":"https://github.com/blacksmithop.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MafiaggBot\n\n![PyPI - Version](https://img.shields.io/pypi/v/mafiagg)\n![Docs](https://img.shields.io/website?url=https%3A%2F%2Fblacksmithop.github.io%2FMafiaggBot%2F\u0026up_message=%E2%9C%85\u0026up_color=%E2%9D%8C\u0026logo=github\u0026label=Docs\u0026link=https%3A%2F%2Fblacksmithop.github.io%2FMafiaggBot%2F)\n![Website](https://img.shields.io/website?url=https://mafiaggstats.netlify.app/%2F\u0026up_message=%E2%9C%85\u0026up_color=%E2%9D%8C\u0026logo=github\u0026label=Dashboard\u0026link=https%3A%2F%2Fblacksmithop.github.io%2FMafiaggBot%2F)\n\n[Dashboard](https://mafiaggstats.netlify.app/)\n\n[API Docs](https://blacksmithop.github.io/MafiaggBot/)\n\n## Usage\n\n---\n\n```shell\npip install -U mafiagg\n```\n\n\n```shell\npip install -U python-dotenv\n```\n\n`python-dotenv` lets you pass a `.env` file with your mafia.gg credentials\n\n```\nMAFIA_USERNAME=username\nMAFIA_PASSWORD=password\n```\n\nIf you wish to enable the chatbot, set these variables\n```\nLLM_PROVIDER=\nGOOGLE_API_KEY=\nOLLAMA_URL=\nAGENT_VERBOSE=\n```\n`LLM_PROVIDER` can  be`ollama`, `google` or `openai`\n\n\u003e TODO: Detailed instructions for LLM's\n\n\n### Example\n\n```python\nfrom mafiagg.client import Bot\nfrom mafiagg.credential_manager import CredentialManager\nfrom sys import exit\n\n\nauth = CredentialManager()\n\nbot = Bot(auth=auth, command_prefix=\"$\")\n\ntry:\n    bot.run()\nexcept KeyboardInterrupt:\n    exit(0)\n```\n\n\u003e When you run the bot for the first time, it will download some metadata it a `./data/` folder.\n\n---\n\n### Features\n\n- [x] Rooms\n  - [x] List rooms\n  - [x] Make private/public\n  - [x] Become player/spectator\n  - [x] Do afk check\n    - [x] Do afk check\n    - [x] Do ready check\n  - [ ] Edit room options\n  - [x] Rename room\n  - [x] Create new room\n    - [x] Only create room when game end\n- [x] Decks\n  - [x] Get deck by name\n  - [x] Set deck by name\n  - [x] Use random deck\n- [x] Setups\n  - [x] Get setup by name\n  - [x] Set setup by code\n  - [x] Set setup by name\n  - [ ] Get current setup code\n- [x] Roles\n  - [x] Get role by name\n  - [x] Cleanup role descriptions, alignment with validator\n- [x] Commands\n  - [x] Custom command names\n  - [x] Command docs\n- [x] Bot Client\n- [x] Authentication\n- [x] Help command\n  - [ ] Formatted / multi-message help command\n- [x] Host only commands\n    - [ ] Host can add admins\n- [x] AI\n    - [x] Chatbot\n    - [x] Multiple LLM support\n      - [x] Tool usage with Langgraph\n    - [] Robust memory\n    - [] Play games with AI\n      - [] Document in game action payloads\n- [] Keep player game statistics\n- [] Create REST Api for [mafiaggstats](https://mafiaggstats.netlify.app/)\n\n### Tasklist\n\n- [ ] Do not allow creation of new room unless game is over\n- [ ] Lookup in game Items\n- [x] Edit room options\n- [ ] Implement conversion of role dictionary to setup codes\n- [ ] Return character info (for decks in next message)\n- [ ] Better commands (sub-commands!)\n- [ ] Better doc strings using decorators\n- [ ] Join other rooms on request\n  - [ ] Check if bot can handle concurrent games, keep session!\n  - [ ] Keep role cache based on room id\n- [ ] Allow for `super().__init__` calls\n- [x] Gracefully end session\n    - [ ] End event loops, close websocket connection\n    - [x] When exiting call DELETE on `user-session` (cookie invalidation)\n\n\n## Development\n\nClone the repo\n\n```shell\ngit clone https://github.com/blacksmithop/MafiaggBot\n\ncd MafiaggBot\n```\n\n---\n\nInstall the dependencies\n\n```shell\npython3 -m pip install -r requirements.txt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacksmithop%2Fmafiaggbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblacksmithop%2Fmafiaggbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacksmithop%2Fmafiaggbot/lists"}