A Discord bot for scheduling events
A Discord bot for scheduling events.
This bot uses the DSharpPlus library.
This codebase represents SchedulerBot version 2 and above, which was rewritten to work on top of the .NET Core platform. The previous (1.x) SchedulerBot codebase, which was written for Node.js, can be found at this repository. The previous codebase is no longer maintained, and is only present for display purposes.
A data migration tool is available for migrating data from a MongoDB database that stores data for SchedulerBot v1.0.x to a PostgreSQL database storing data for v2.0. See the readme in the SchedulerBot.MigrationTool
project for further details.
All command examples given assume the use of a Bash shell.
$ git clone https://github.com/pyrox18/SchedulerBot.git
schedulerbot
.appsettings.json
file in SchedulerBot/SchedulerBot.Client
comes with default settings for the client to run. To override any of these settings, create an appsettings.Development.json
file in SchedulerBot/SchedulerBot.Client
with the key-value pairs that you want to override with the same hierarchy:{
"Logging": {
"LogLevel": {
"Default": "Debug"
}
},
"ConnectionStrings": {
"SchedulerBotContext": "Server=localhost;Database=schedulerbot;Username=someuser;Password=abc123"
},
"Bot": {
"Token": "YOUR_BOT_TOKEN_HERE"
}
}
Replace YOUR_BOT_TOKEN_HERE
with the app bot user token generated earlier.
$ cd SchedulerBot
$ dotnet restore SchedulerBot.sln
$ cd SchedulerBot/SchedulerBot.Data
$ ASPNETCORE_ENVIRONMENT=Development dotnet ef database update -s ../SchedulerBot.Client/SchedulerBot.Client.csproj
SchedulerBot.Client
project.$ cd ../SchedulerBot.Client
$ dotnet build
$ cd bin/Debug/netcoreapp2.1
$ ASPNETCORE_ENVIRONMENT=Development dotnet SchedulerBot.Client.dll
Alternatively, open the solution in Visual Studio and debug the SchedulerBot.Client
project from there.
This project has support for Docker.
To build and run:
$ docker build . -t schedulerbot:dev
$ docker run -e "ASPNETCORE_ENVIRONMENT=Development" -d schedulerbot:dev
Production application settings should be placed in a appsettings.Production.json
file in the SchedulerBot.Client
project directory. The contents are similar to the appsettings.Development.json
file, with the addition of a section for providing the DSN to report errors to for the Sentry error reporting service.
{
"ConnectionStrings": {
"SchedulerBotContext": "Server=localhost;Database=schedulerbot;Username=someuser;Password=abc123"
},
"Bot": {
"Token": "YOUR_BOT_TOKEN_HERE"
}
"Raven": {
"DSN": "https://<key>@sentry.io/<project>"
}
}
Alternatively, these settings can be set with environment variables when running the client. Separate hierarchical keys and array index keys with the __
(double underscore) separator.
$ ASPNETCORE_ENVIRONMENT=Production Bot__Token=YOUR_BOT_TOKEN_HERE Prefixes__0=++ Raven__DSN=https://[email protected]/bot dotnet SchedulerBot.Client.dll
The SchedulerBot source code is distributed under the GNU General Public License v3.0.
Refer to the CONTRIBUTING.md file for more information on how to contribute to the development of SchedulerBot.
Discuss about the development of SchedulerBot on the #development channel of the SchedulerBot support server.