Einherji is my private Discord administration bot. It mainly contains features that are useful to me or my friends.
Einherji is built using .NET Core Hosting approach, making use of its Dependency Injection container, Logging abstractions and configuration loading.
Uses Discord.Net for connection and MongoDB (using C# MongoDB Driver) for storage. The bot contains a custom Regex Commands System built on top of Discord.Net's default command system. Its implementation can be found in CommandsProcessing directory.
The bot is split into 2 projects:
- EinherjiBot.General - contains bot's main features.
- EinherjiBot.Core - contains extensions and core abstractions.
Note: requires .NET 5 SDK since version 2.3.0.
- Clone this repository to get all files.
- Set up MongoDB database with following collections:
Miscellaneous
,StellarisMods
,PatchbotGames
,EliteCommunityGoals
andUsersData
. - Create
appsecrets.json
file. See example file for example structure.
This file will hold secrets, so it should not be included in source control repository..gitignore
file included with this repo will ignoreappsecrets.json
andappsecrets.*.json
files. - Add bot token from Discord Developer Portal to secrets file.
- Add MongoDB connection string for your DB to secrets file.
- (optional) If using DataDog for logs, create a following section in
appsecrets.json
, replacying<api-key>
with your DataDog application API key:
"Serilog": {
"DataDog": {
"ApiKey": "<api-key>"
}
}
- (optional) If you're registered with Inara API, create a following section in
appsecrets.json
, replacing all tags as needed. Note: not prividing these values will disable Elite Dangerous Community Goals checker feature.
"EliteCommunityGoals": {
"InaraAppInDevelopment": true,
"InaraAppName": "<app-name>",
"InaraApiKey": "<api-key>"
}
- Update appsettings.json. At very least, all channel, user and role IDs will need changing to match values in your Discord guild.
- Build and run
EinherjiBot.General
project.
This bot is under continuous (if sometimes slow) development. Breaking changes might be introduced at any time.
If you spot a bug or want to suggest a feature or improvement, feel free to open a new Issue.
Copyright (c) 2020 TehGM
Licensed under Apache License 2.0.