Pull Requests and Issues are welcomed, .NET 6+ is required.
Discord bot for API verification and user data parsing from already created user at MintyBar. Built to give rewards to community for their activity and to help track progress. You can check out the bot at our server (#rori).
Rori is made to simplify tracking progress from profile at MintyBar and is not meant to replace the main HUB. Bot functions:
- Server verification by MintyBar token
- MintyBar profile connect
- Show progress data and timings
- Give items/gifts for activity
- Shop for activity coins
- Notify about events and your timings
- Daily quests/Mini-games
- Show rules/info
- Have an existential crisis
- Install Visual Studio (its free)
- Clone/Download the repo (green button in upper right
<> Code
) - Navigate to the local folder where you downloaded project
- Create and setup your bot:
Create new application at Discord Developer Portal:
Click on reset token and get your token
Open configs folder, startup_config.json (please move
configs
folder tobin/Debug/netX/
folder if you run from Visual Studio, like so:Rori-Discord-Bot/bin/Debug/net6/configs/
) and edit token from your dev portal (create a bot and copy token)
- Open project in Visual Studio (if you havent done so already) or just double click
Rori-discord.sln
, Visual Studio will automatically start things - When its loaded press F5 to start debugging or a play button up top
- Have fun playing around changing letters (all slash cmds is inside
./Commands/Slash
and startup point is in./Program.cs
)
Caution
Please dont show anyone your Token from dev portal, nor hardcode it, especially if you are planning to show your code to friends or upload on github. Token will give full access to other people. If you did, in fact, shown it - immediatelly go to dev portal and reset it.
Warning
Most of the time SQLite is enough, especially for not hella populated servers, it is fast and simple. Changing DB Connector meaning u know what u doing
Rori heavely utilizes concept of inheritence, so to change Database you just go to ./Databases
and create new XXXXXDataHandler.cs
that inherits from IDatabaseHandler<TDataGet, TDataSend>
.
If you need entire new Database connection logic, you might also need to go to
./Databases/Connectors/
and either re-write ours or add your own that inherits fromIDatabaseConnector
.
Functionality divided like this:
DbConnector.cs
- used for connect to the database with password and ports, what it does is just hold the connection between app and database on remoteDataHandler.cs
- transfers data of your choice (UserData for example) and handles state between plain code/json into classes and backwardsQueryHandler.cs
- utility class used for passing query toDataHandler
, in case you wanna do some non-standart operations on your database or get only part of data. It might be optional, depends on ur needs
Once its done simply change the current used abstractions in ./Program.cs
like that:
XXXXX are meant to be your database:
var dbInfo = await GetDatabaseConfig<XXXXXXDatabaseConfig>("xxxxx_dbconfig.json");
IDatabaseHandler<UserData, UserData> dataHandler = new XXXXXXDataHandler(dbInfo.DbConfig, dbInfo.Config);
Note
You can change IDatabaseHandler<UserData, UserData>
to IDatabaseHandler<UserData, UserCredentials>
for example, if you dont wanna push entire class. Or even move generic from Class
-based to Method
-based if you want more flexibility.
Thanks to @Escartem for French localization.