{"id":24719302,"url":"https://github.com/simon-gardier/discord-game","last_synced_at":"2026-05-08T11:04:56.698Z","repository":{"id":242569309,"uuid":"808623133","full_name":"simon-gardier/discord-game","owner":"simon-gardier","description":"⌨️1vs1 game for Discord implemented in C++ with D++","archived":false,"fork":false,"pushed_at":"2024-06-03T18:05:47.000Z","size":303,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T11:48:01.196Z","etag":null,"topics":["cpp","discord","discord-bot","discord-game","dpp","game","info0004"],"latest_commit_sha":null,"homepage":"https://dpp.dev/","language":"C++","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/simon-gardier.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":"2024-05-31T13:05:14.000Z","updated_at":"2024-06-03T18:05:50.000Z","dependencies_parsed_at":"2024-06-03T21:04:48.147Z","dependency_job_id":null,"html_url":"https://github.com/simon-gardier/discord-game","commit_stats":null,"previous_names":["simon-gardier/discord-game"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simon-gardier/discord-game","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon-gardier%2Fdiscord-game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon-gardier%2Fdiscord-game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon-gardier%2Fdiscord-game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon-gardier%2Fdiscord-game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simon-gardier","download_url":"https://codeload.github.com/simon-gardier/discord-game/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon-gardier%2Fdiscord-game/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32777659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cpp","discord","discord-bot","discord-game","dpp","game","info0004"],"created_at":"2025-01-27T11:17:21.282Z","updated_at":"2026-05-08T11:04:56.651Z","avatar_url":"https://github.com/simon-gardier.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⌨️ Discord game bot\n![Release](https://img.shields.io/badge/Release-v1.0-blueviolet?style=for-the-badge)\n![Language](https://img.shields.io/badge/c++-%2300599C.svg?style=for-the-badge\u0026logo=c%2B%2B\u0026logoColor=white)\n\nDiscord bot allowing you to play games against your friends in your Discord server! (Or against the bot if you do not have any)\n\n\u003cdiv style=\"display: flex; justify-content: space-around; align-items: center;\"\u003e\n  \u003cimg src=\"misc/main.png\" alt=\"bayes filter\" style=\"width: 70%;\"/\u003e\n\u003c/div\u003e\n\nThe bot is implemented in C++ using [D++](https://dpp.dev/). \n\nThe games are saved in a JSON backup. The games are restored after each restart.\n\nThis project was done in the context of the [INFO0004 course](https://www.programmes.uliege.be/cocoon/20232024/cours/INFO0004-2.html).\n\nNote : No copying (even partial) of this code within the scope of the INFO0004 course will be tolerated.\n\n## Summary\n1. [Try it!](#try-it)\n2. [Troubleshooting](#troubleshooting)\n3. [Entrapment - Game rules](#entrapment---game-rules)\n4. [Entrapement - Interactions](#entrapement---interactions)\n5. [Credits](#credits)\n\n## Try it!\n1. Follow the [tutorial on the D++ page](https://dpp.dev/creating-a-bot-application.html) to create a new bot and generate a bot token. When you create the bot you can leave its permissions to 0.\n\n2. Invite the bot on your Discord server and assign it a role with \"Administrator\" permissions.\n\n3. Run the `make` command in your terminal, then run `./entrapment botToken` where botToken is the token created at step 1.\n\n4. Summon a new game with the command `/trap @playerMention`.\n\n## Troubleshooting\n\nIf your bot prints an error like this in the terminal : `[2024-06-03 08:21:12] ERROR: Error: 50001: Missing Access`, be sure you have checked the `applications.commands` and `bot` scope in the OAuth2 URL Generator :\n\n\u003cdiv style=\"display: flex; justify-content: space-around; align-items: center;\"\u003e\n  \u003cimg src=\"misc/scope.png\" alt=\"bayes filter\" style=\"width: 90%;\"/\u003e\n\u003c/div\u003e\n\n## Entrapment - Game rules\nEntrapment is a channel game played in 1vs1 (against player or a bot).\n\nThe game is played on a grid, empty at the start. When a player move he leaves a mine at his previous position.\n\nThe goal of each player is to trap the other. A player is trapped if he can not move anymore, i.e. if he is surrounded by mines/the other player.\n\n## Entrapement - Interactions\n- A player can start a game using the command `/trap playerName` where playerName is the name of a player or your bot\n\u003cdiv style=\"display: flex; justify-content: space-around; align-items: center;\"\u003e\n  \u003cimg src=\"misc/trap.png\" alt=\"Trap command message\" style=\"width:85%;\"/\u003e\n\u003c/div\u003e\n\n- A player can play a move by clicking a red cell when it is its turn.\n\u003cdiv style=\"display: flex; justify-content: space-around; align-items: center;\"\u003e\n  \u003cimg src=\"misc/first.png\" alt=\"First turn message\" style=\"width: 85%;\"/\u003e\n\u003c/div\u003e\n\n- A player can surrend by reacting to the game message with the emoji ❌ (i.e :x: ) :\n\u003cdiv style=\"display: flex; justify-content: space-around; align-items: center;\"\u003e\n  \u003cimg src=\"misc/surrender.png\" alt=\"Wrong game message\" style=\"width: 85%;\"/\u003e\n\u003c/div\u003e\n\n- If a player tries to play when it is not its turn, he receives a message from the bot :\n\u003cdiv style=\"display: flex; justify-content: space-around; align-items: center;\"\u003e\n  \u003cimg src=\"misc/turn.png\" alt=\"Wrong turn message\" style=\"width: 85%;\"/\u003e\n\u003c/div\u003e\n\n- If someone interacts with a game he is not part of, he receives a message from the bot :\n\u003cdiv style=\"display: flex; justify-content: space-around; align-items: center;\"\u003e\n  \u003cimg src=\"misc/wrong_game.png\" alt=\"Wrong game message\" style=\"width: 85%;\"/\u003e\n\u003c/div\u003e\n\n- If someone interacts with an unknown game (happens if the backups are deleted), he receives a message from the bot :\n\u003cdiv style=\"display: flex; justify-content: space-around; align-items: center;\"\u003e\n  \u003cimg src=\"misc/unknown.png\" alt=\"Unknown game message\" style=\"width:85%;\"/\u003e\n\u003c/div\u003e\n\n\n## Credits\n- [Simon Gardier](https://github.com/simon-gardier) (Co-author)\n- Camille Trinh\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimon-gardier%2Fdiscord-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimon-gardier%2Fdiscord-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimon-gardier%2Fdiscord-game/lists"}