2018-08-05 19:36:16 +05:00
RPCS3 Compatibility Bot
=======================
2018-02-16 20:58:05 +05:00
2019-08-26 16:57:32 +05:00
[![Build Status ](https://dev.azure.com/rpcs3-bot/RPCS3%20Bot/_apis/build/status/RPCS3.discord-bot?branchName=master )](https://dev.azure.com/rpcs3-bot/RPCS3%20Bot/_build/latest?definitionId=1& branchName=master) [![RPCS3 discord server ](https://discordapp.com/api/guilds/272035812277878785/widget.png )](https://discord.me/rpcs3)
2019-08-23 17:59:04 +05:00
2019-08-26 16:57:32 +05:00
This is a tech support / moderation / crowd entertainment bot for the [RPCS3 discord server ](https://discord.me/rpcs3 ).
2019-02-13 21:40:59 +05:00
2019-03-29 19:51:44 +05:00
You can read the design and implementation notes by visiting the folders in the web interface, or from the [architecture overview notes ](architecture.md ).
2018-07-19 17:42:48 +05:00
Development Requirements
------------------------
2019-12-04 01:21:36 +05:00
* [.NET Core 3.1 SDK ](https://dotnet.microsoft.com/download ) or newer
2019-02-13 21:40:59 +05:00
* Any text editor, but here are some recommends:
* [Visual Studio ](https://visualstudio.microsoft.com/ ) (Windows and Mac only, has free Community edition)
* [Visual Studio Code ](https://code.visualstudio.com/ ) (cross-platform, free)
* [JetBrains Rider ](https://www.jetbrains.com/rider/ ) (cross-platform)
2018-02-16 20:58:05 +05:00
2018-07-19 17:42:48 +05:00
Runtime Requirements
--------------------
2019-12-04 01:21:36 +05:00
* [.NET Core 3.1 SDK ](https://dotnet.microsoft.com/download ) or newer to run from sources
2019-03-01 05:47:06 +05:00
* needs `dotnet` command available (i.e. alias for the Snap package)
2019-12-04 01:21:36 +05:00
* [.NET Core 3.1 Runtime for server apps ](https://dotnet.microsoft.com/download ) or newer for compiled version
2019-03-01 05:47:06 +05:00
* Optionally Google API credentials to access Google Drive:
* Create new project in the [Google Cloud Resource Manager ](https://console.developers.google.com/cloud-resource-manager )
2019-03-01 14:06:55 +05:00
* Select the project and enable [Google Drive API ](https://console.developers.google.com/apis/library/drive.googleapis.com )
2019-03-29 19:51:44 +05:00
* Open [API & Services Credentials ](https://console.developers.google.com/apis/credentials )
2019-03-01 05:47:06 +05:00
* Create new credentials:
* **Service account** credentials
* New service account
2019-03-01 22:52:52 +05:00
* if you select an existing account, **new** credentials will be generated **in addition** to previous any ones
* Role **Project > Viewer**
2019-03-01 05:47:06 +05:00
* Key type **JSON**
2019-03-01 14:06:55 +05:00
* **Create** will generate a configuration file
2019-09-24 14:56:49 +05:00
* Save said configuration file as `credentials.json` in [user secrets ](https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-3.0#how-the-secret-manager-tool-works ) folder
2019-03-01 22:34:39 +05:00
* e.g on Linux this will be `~/.microsoft/usersecrets/c2e6548b-b215-4a18-a010-958ef294b310/credentials.json`
2018-02-16 20:58:05 +05:00
2018-07-19 17:42:48 +05:00
How to Build
------------
* Change configuration for test server in `CompatBot/Properties/launchSettings.json`
* Note that token could be set in the settings _or_ supplied as a launch argument (higher priority)
* If you've changed the database model, add a migration
2019-10-31 19:21:04 +05:00
* `$ dotnet tool install --global dotnet-ef` (if you have never installed the tools before)
2018-07-19 17:42:48 +05:00
* `$ cd CompatBot`
2018-08-03 21:39:57 +05:00
* `$ dotnet ef migrations add -c [BotDb|ThumbnailDb] MigrationName`
2018-07-19 17:42:48 +05:00
* `$ cd ..`
* `$ cd CompatBot`
* `$ dotnet run [token]`
2018-02-16 20:58:05 +05:00
2018-07-19 17:42:48 +05:00
How to Run in Production
------------------------
2019-08-24 20:46:10 +05:00
### Running from source
2019-03-01 22:52:52 +05:00
* Change configuration if needed (probably just token):
2019-03-01 15:56:54 +05:00
* use `$ dotnet user-secrets set Token <your_token_here>`
2019-03-01 22:52:52 +05:00
* for available configuration variables, see [Config.cs ](CompatBot/Config.cs#L31 )
* Put `bot.db` in `CompatBot/` if you have one
2018-07-19 17:42:48 +05:00
* `$ cd CompatBot`
2019-03-01 22:52:52 +05:00
* `$ dotnet run -c Release`
2019-02-02 20:03:51 +05:00
2019-08-24 20:46:10 +05:00
### Running with Docker
2019-09-30 20:17:43 +05:00
* Official image is hosted on [Docker Hub ](https://hub.docker.com/r/rpcs3/discord-bot ).
2019-08-24 20:46:10 +05:00
* You should pull images tagged with `release-latest` (same thing as `latest` )
* Please take a look at the [docker-compose.yml ](docker-compose.yml ) for required configuration (bot token and mounting points for persistent data).
2019-02-02 20:03:51 +05:00
External resources that need manual updates
-------------------------------------------
* [Unicode confusables ](http://www.unicode.org/Public/security/latest/confusables.txt ) gzipped, for Homoglyph checks
2019-09-30 20:17:43 +05:00
* Optionally [Redump disc key database ](http://redump.org/downloads/ ) in text format (requires membership)