{"id":17012140,"url":"https://github.com/emanuel-de-jong/10kranker","last_synced_at":"2026-05-06T23:36:01.550Z","repository":{"id":152246840,"uuid":"381820962","full_name":"Emanuel-de-Jong/10KRanker","owner":"Emanuel-de-Jong","description":"A discord bot that keeps track of 10 key mania maps that their mappers want to get ranked.","archived":false,"fork":false,"pushed_at":"2021-10-31T14:40:45.000Z","size":517,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-27T13:15:24.277Z","etag":null,"topics":["bot","csharp","discord","osu","osumania"],"latest_commit_sha":null,"homepage":"https://discord.gg/PwzcUzk","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/Emanuel-de-Jong.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":"2021-06-30T20:09:17.000Z","updated_at":"2021-10-31T14:40:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"18930269-be39-43bb-81ad-9668370b45cb","html_url":"https://github.com/Emanuel-de-Jong/10KRanker","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/Emanuel-de-Jong%2F10KRanker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emanuel-de-Jong%2F10KRanker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emanuel-de-Jong%2F10KRanker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emanuel-de-Jong%2F10KRanker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Emanuel-de-Jong","download_url":"https://codeload.github.com/Emanuel-de-Jong/10KRanker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244966461,"owners_count":20539794,"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":["bot","csharp","discord","osu","osumania"],"created_at":"2024-10-14T06:09:40.500Z","updated_at":"2026-05-06T23:36:01.544Z","avatar_url":"https://github.com/Emanuel-de-Jong.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 10KRanker\nA [discord bot](https://discord.com/developers/docs/intro#bots-and-apps) that keeps track of 10 key [mania](https://osu.ppy.sh/wiki/en/Game_mode#-osu!mania) maps that their mappers want to get [ranked](https://osu.ppy.sh/wiki/en/Beatmap/Category#ranked).\n\nI will be used it in the [10+ Key Rhythm Games](https://discord.gg/PwzcUzk) discord server.\n\nIt's good enough for what it will be used for. But for bigger projects, it would need some optimalizations. Especially in asynchronous programming.\n\n**Active Development:** 2021-06-30 - 2021-07-11\u003cbr\u003e\n**Last Change:** 2021-10-30\u003cbr\u003e\n\n| | |\n| :---: | :---: |\n| ![](/Screenshots/1-Help_Command.png) | ![](/Screenshots/2-List_Command.png) |\n\n## Commands\nDiscord users use commands to interact with the bot. All commands for this bot need to be prefixed with: `!`\u003cbr/\u003e\nThe commands are as follows:\u003cbr/\u003e\n`\u003c\u003e` = Required\u003cbr/\u003e\n`()` = Optional\u003cbr/\u003e\n`|` = Or\u003cbr/\u003e\n`\"\"` = Send a name/title with spaces as 1 value\u003cbr/\u003e\n\n***Maps***\u003cbr/\u003e\n`!add`   `\u003cmap link|beatmapsetid\u003e`   `(status)`\u003cbr/\u003e\nAdd a map and describe in what stage of the mapping/ranking/modding proces it is.\u003cbr/\u003e\n`!rm`   `\u003cmap link|beatmapsetid|map title\u003e`\u003cbr/\u003e\nRemove a map.\u003cbr/\u003e\n`!changestatus`   `\u003cmap link|beatmapsetid|map title\u003e`   `\u003cstatus\u003e`\u003cbr/\u003e\nChange the status of a map. The status describes how the mapping/ranking/modding of a map is going.\u003cbr/\u003e\n\n***Beatmap Nominators***\u003cbr/\u003e\n`!addbn`   `\u003cmap link|beatmapsetid|map title\u003e`   `\u003cbn link|userid|bn name\u003e`\u003cbr/\u003e\nLink a BN to a map. A map can have multiple BNs.\u003cbr/\u003e\n`!rmbn`   `\u003cmap link|beatmapsetid|map title\u003e`   `\u003cbn link|userid|bn name\u003e`\u003cbr/\u003e\nRemove a BN from a map.\u003cbr/\u003e\n\n***Show maps***\u003cbr/\u003e\n`!show`   `\u003cmap link|beatmapsetid|map title\u003e`\u003cbr/\u003e\nShow the details of a map.\u003cbr/\u003e\n`!list`   `(user link|userid|user name)`\u003cbr/\u003e\nList all maps, the maps of a mapper or the maps linked to a BN.\u003cbr/\u003e\n\n***Other***\u003cbr/\u003e\n`!info`\u003cbr/\u003e\nShow this message.\u003cbr/\u003e\n\n## Issues\n***I get the error: `The type initializer for 'Database.DB' threw an exception.` for every command.***\u003cbr/\u003e\nThe Database project (Entity Framework Core) can't connect to the db file. Probably because the data source configuration has changed.\u003cbr/\u003e\nA new migration has to be generated:\n1. Delete the Migrations folder.\n2. Set the startup project to the Database project.\n3. Open the Package Manager Console (PMC) in VS.\n4. Give in the following commands:\n    - `Add-Migration YourMigrationName`\n    - `Update-Database`\n5. Set the startup project back to the 10KRanker project.\n\n## Code structure\nThere are 5 Visual Studio projects\n\n### 10KRanked\n***Type:*** C# .NET 5 Console Application\u003cbr/\u003e\n***Dependencies:*** [Discord.Net 2.4.0](https://www.nuget.org/packages/Discord.Net/2.4.0), [Microsoft.Extensions.DependencyInjection 5.0.1](https://www.nuget.org/packages/Microsoft.Extensions.DependencyInjection/5.0.1)\n\nThe discord bot itself. It uses Discord.Net so we don't have to worry about the connection to discord, reading and filtering command calls and parsing command parameters. It uses the next 2 projects to retrieve and save all the data it needs.\u003cbr/\u003e\nThere are 3 classes that have most of the logic:\u003cbr/\u003e\n***Modules/MainModule:*** Handles the commands.\u003cbr/\u003e\n***Validator:*** Most command parameters can be in multiple formats. This class gets the format type and converts the input accordingly.\u003cbr/\u003e\n***OsuToDB:*** Combines the user input and info from OsuAPI to create and update Database entries.\u003cbr/\u003e\n\nE.g adding a map would look like this (pseudo naming):\u003cbr/\u003e\nValidator.GetMapType(Input) -\u003e Validator.MapTypeXToId(MapType)\u003cbr/\u003e\n-\u003e (OsuToDB.CreateMap(MapId) -\u003e Osu.GetMap(MapId)) -\u003e DB.Add(Map)\n\n### OsuAPI\n***Type:*** C# .NET 5 Library\u003cbr/\u003e\n***Dependencies:*** [OsuSharp 5.4.4](https://www.nuget.org/packages/OsuSharp/5.4.4)\n\nHas a static wrapper for easy communication with osu. 10KRanked uses it to get information about maps and users. It throws exceptions when a map/user doesn't exist and if a map is incompatible with our standards.\n\n### Database\n***Type:*** C# .NET 5 Library\u003cbr/\u003e\n***Dependencies:*** [Microsoft.EntityFrameworkCore.Sqlite/Tools/Design 5.0.7](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore/5.0.7)\n\nHas a static wrapper for easy communication with a SQLite db file located in the OS's ApplicationData. It uses auto generated migrations to speed up database design changes.\n10KRanked uses it to save and retrieve the maps/users.\n\n### Logger\n***Type:*** C# .NET 5 Library\u003cbr/\u003e\n\nIts Log class can be instanced with a filename. The Write function appends a string to the `.log` file. It is used to log the user commands, osu api calls and database changes.\n\n### Test\n***Type:*** C# .NET 5 Console Application\u003cbr/\u003e\n\nUsed to test individual features without the overhead and complexity of the discord bot.\n\n## Running your own version\nI'm asuming you are using Visual Studio 2019.\n\n1. Fill in the secret templates and rename their file and class name to `Secret`.\n    - [10KRanked template](https://github.com/Emanuel-de-Jong/10KRanker/blob/7950235b3674a0618c2475c4ce9c88a4d7d1e8dc/src/10KRanker/SecretsTemplate.cs)\n    - [OsuAPI template](https://github.com/Emanuel-de-Jong/10KRanker/blob/7950235b3674a0618c2475c4ce9c88a4d7d1e8dc/src/OsuAPI/SecretsTemplate.cs)\n2. That is it for now.\n\n## Testing\nThe 10KRanked project has a UnitTest class that acts as a discord user and calls commands. It goes through most of the possible and invalid parameters of the commands.\u003cbr/\u003e\nBefore testing, make a backup of your db file and put an empty db file in its place.\u003cbr/\u003e\nTo start the test, set the UnitTest Testing bool to true, and run the bot.\n ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femanuel-de-jong%2F10kranker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femanuel-de-jong%2F10kranker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femanuel-de-jong%2F10kranker/lists"}