This is the gthx IRC bot reimplemented in C# instead of the original python. The main reasons for this are :
GthxNetBot supports both MariaDB and SQL Server. One of these must be installed with a database created for the bot and a user granted all permissions on the database.
To use with Visual Studio, install Visual Studio with the following features enabled:
Then install the .NET 6 SDK
GthxNetBot uses a source subrepo, so when cloning to build, be sure use the --recurse-submodules when cloning: git clone --recurse-submodules https://github.com/gunnbr/GthxNetBot.git Or if you have cloned without doing this, the subrepo can be initialized by running:
git submodule update --init
Modifying or adding features is done mainly in the Modules folder in the Gthx.Bot project. To add a new module, add a new .cs file here that implements IGthxModule, then implement the interface, following the pattern from the existing modules.
Use Ctrl-Shift-B or the Build->Build Solution menu item to build from Visual Studio
dotnet build
To build and tag with docker, use
docker build -t gthxnetbot:latest .
Edit appsettings.json
before running or set environment variables before running
Use F5 to run through the debugger, Ctrl-F5 to run without the debugger or the Debug->Start Debugging menu item to run through Visual Studio
dotnet run
Or find the compiled executables in the bin/Debug/net6.0
To run with environment overrides and network access to localhost and automatic restart, use:
docker run -d --env-file ./gthx.env --network="host" --restart unless-stopped gthxnetbot:latest
If you have modified the appsettings.json or added environment variables to configure, then you can leave out the "--env-file ./gthx.env" part. Otherwise, copy "gthx.env.example" to "gthx.env" and edit it to suit your installation.
Then status can be monitored by way of the configured logging.