You can contribute to either Sanara or this website from their GitHub, feel free to open pull requests and issues if you need to:
Using Sanara by cloning the repository▼
At first you'll need to clone Sanara repository:
git clone https://github.com/Xwilarg/Sanara.git
You will then need to install rethinkdb, which is what the bot used for its database:
Then you can build the bot, but before starting you'll need to add the credentials for the various services
For that, go next to the executable (by default: Sanara/bin/Debug/net6.0) and create a folder called "Keys", inside create a file called "Credentials.json"
This file will contains all your keys, stored in JSON format
Only "BotToken" is mandatory, it'll contain your bot token that you can find on the Discord developper portail
Others fields are:
- UploadWebsiteUrl: URL of the website used for download doujinshi/cosplay commands
- UploadWebsiteLocation: Local folder associated to UploadWebsiteUrl
- KitsuEmail: Email of your Kitsu account, allow NSFW search for anime/manga/light novel commands
- KitsuPassword: Password of KitsuEmail
- SentryKey: Sentry.io token, used for automatic crash report
- TopGgToken: Top.gg token, update guild count there
- MyDramaListApiKey: Token used for Drama command
- UnsplashToken: Token used for Photo command
- DebugGuild: ID of the guild you used to test stuff, if given, slash commands when only be created in this guild when the debugger is attached
For all Google related services (Translation and Vision), you'll also need the JSON created from their developer page, put it in the Keys/ folder and rename it GoogleAPI.json
Improving Sanara▼
To improve Sanara yourself you'll need some C# and Discord.Net knowledge.
If you are ready, you can setup the bot as described in the previous step.
Here is some explanation of what you can find inside the Sanara/ folder:
- Database: Contains all functions that interact with the database
- Diaporama: Diaporama allows a command to display an embed containing a list of data, in which you can naviguate using buttons
- Exception: Custom exceptions used within Sanara
- CommandFailed: Thrown when something failed within a command (like an invalid parameter value), caught and then show an error to the user
- GameLost: Used within the game module, make the current game to fail
- InvalidGameAnswer: Used within the game module, indicate that the current user answer is invalid
- Game: Sanara's game module
- Impl: Implementation of the games
- MultiplayerMode: Implementation of different way that multiplayer can be handled
- PostMode: Implementation of how messages must be sent on Discord
- PostMode: Implementation of how messages must be sent on Discord
- Preload: Allows to preload data when the bot start and keep them in cache
- Help: Export of Help information for this website
- LanguageResource: JSON files used to convert Romaji from/to Hiragana/Katakana
- Module: All commands of Sanara split into various modules
- Subscription: Subscription follow a service and post message in a channel everytimes a new information is available
- Constants.cs: Some constants used in the whole code
- Credentials.cs: Deserialisation of Keys/Credentials.json
- Log.cs: Format and log messages, including errors
- Program.cs: Entry point and core of the bot
- StaticObjects.cs: Store static instance of variables that are used at many place in the code
- Utils.cs: Static methods that are used at various places in the code