discord-bot/README.md

60 lines
3.4 KiB
Markdown
Raw Normal View History

RPCS3 Compatibility Bot
=======================
2019-08-26 11:57:32 +00: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 12:59:04 +00:00
2019-08-26 11:57:32 +00:00
This is a tech support / moderation / crowd entertainment bot for the [RPCS3 discord server](https://discord.me/rpcs3).
2019-02-13 16:40:59 +00:00
2019-03-29 14:51:44 +00: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).
Development Requirements
------------------------
* [.NET Core 2.1 SDK](https://www.microsoft.com/net/download/windows) or newer
2019-02-13 16:40:59 +00: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)
Runtime Requirements
--------------------
* [.NET Core 2.1 SDK](https://www.microsoft.com/net/download/windows) or newer to run from sources
2019-03-01 00:47:06 +00:00
* needs `dotnet` command available (i.e. alias for the Snap package)
2019-02-02 15:03:51 +00:00
* [.NET Core 2.1 Runtime](https://www.microsoft.com/net/download/windows) or newer for compiled version
2019-03-01 00:47:06 +00: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)
* Select the project and enable [Google Drive API](https://console.developers.google.com/apis/library/drive.googleapis.com)
2019-03-29 14:51:44 +00:00
* Open [API & Services Credentials](https://console.developers.google.com/apis/credentials)
2019-03-01 00:47:06 +00:00
* Create new credentials:
* **Service account** credentials
* New service account
2019-03-01 17:52:52 +00:00
* if you select an existing account, **new** credentials will be generated **in addition** to previous any ones
* Role **Project > Viewer**
2019-03-01 00:47:06 +00:00
* Key type **JSON**
* **Create** will generate a configuration file
2019-03-01 17:52:52 +00:00
* Save said configuration file as `credentials.json` in [user secrets](https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-2.2#how-the-secret-manager-tool-works) folder
* e.g on Linux this will be `~/.microsoft/usersecrets/c2e6548b-b215-4a18-a010-958ef294b310/credentials.json`
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
* `$ cd CompatBot`
* `$ dotnet ef migrations add -c [BotDb|ThumbnailDb] MigrationName`
* `$ cd ..`
* `$ cd CompatBot`
* `$ dotnet run [token]`
How to Run in Production
------------------------
2019-03-01 17:52:52 +00:00
* Change configuration if needed (probably just token):
2019-03-01 10:56:54 +00:00
* use `$ dotnet user-secrets set Token <your_token_here>`
2019-03-01 17:52:52 +00:00
* for available configuration variables, see [Config.cs](CompatBot/Config.cs#L31)
* Put `bot.db` in `CompatBot/` if you have one
* `$ cd CompatBot`
2019-03-01 17:52:52 +00:00
* `$ dotnet run -c Release`
2019-02-02 15:03:51 +00:00
External resources that need manual updates
-------------------------------------------
* [Unicode confusables](http://www.unicode.org/Public/security/latest/confusables.txt) gzipped, for Homoglyph checks
2019-03-29 14:51:44 +00:00
* Optionally [Redump disc key database](http://redump.org/downloads/) in text format (requires membership)