Skip to content

TehGM/EinherjiBot

Repository files navigation

Einherji Bot

GitHub top language GitHub GitHub Workflow Status GitHub issues

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.

Running locally

Note: requires .NET 5 SDK since version 2.3.0.

  1. Clone this repository to get all files.
  2. Set up MongoDB database with following collections: Miscellaneous, StellarisMods, PatchbotGames, EliteCommunityGoals and UsersData.
  3. 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 ignore appsecrets.json and appsecrets.*.json files.
  4. Add bot token from Discord Developer Portal to secrets file.
  5. Add MongoDB connection string for your DB to secrets file.
  6. (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>"
  }
}
  1. (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>"
}
  1. Update appsettings.json. At very least, all channel, user and role IDs will need changing to match values in your Discord guild.
  2. Build and run EinherjiBot.General project.

Development

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.

License

Copyright (c) 2020 TehGM

Licensed under Apache License 2.0.