MonkeyBot
MonkeyBot copied to clipboard
General purpose C# Discord Bot written for the Monkey Gamers Community
MonkeyBot
A general purpose Discord Bot for the Monkey Gamers community written in C#
Explore the available commands »
Join Chat
·
Report Bug
·
Request Feature
Table of Contents
-
About MonkeyBot
- Built With
-
Getting Started
- Prerequisites
- Installation
- Usage
- Troubleshooting
- Roadmap
- Contributing
- License
- Contact
- Acknowledgements
About MonkeyBot
MonkeyBot is a general purpose Discord Bot that was created for the needs of the Monkey Gamers community. Its main functions are:
- Welcoming new users
- Get updates from various feeds (ATOM/RSS)
- (Self) role assignments
- Scheduled announcements
- Game server tracking
- Stream announcements
- Handling of applicants (planned)
- Silly stuff like Picture search, Trivia, Chuck Norris jokes, Benzen Facts, xkcd...
Built With
- .NET 7
- DSharpPlus
- nChronic
- CodeHollow.FeedReader
- Fluent Command Line Parser
- FluentScheduler
- Html Agility Pack
- Humanizer
- Microsoft.EntityFrameworkCore
- NCrontab
- NLog
- SQLite
- SteamQueryNet
Getting Started
Prerequisites
- Latest .NET SDK for your platform (7.0 or later) - you can download it here
- A registered Discord application with a bot access token. If you don't have one, you can create one with your existing Discord account here. There you have to add a Bot and need to copy both Bot Token and Client ID. To then add the bot to your Discord server go to
https://discordapp.com/oauth2/authorize?scope=bot&permissions=0&client_id=[ID]
, replacing [ID] with the Client ID of your bot (not the token) - Optional: An IDE of your choice (Visual Studio 2022 recommended)
Installation
-
Clone the repo
git clone https://github.com/MarkusKgit/MonkeyBot.git
or download it from GitHub and unzip it
-
Pick the right branch The latest stable version is on the main branch:
git checkout main
If you want to try the latest development build then check out the development branch:git checkout develop
-
Build
cd MonkeyBot dotnet build
or open the solution in Visual Studio and build
-
Run
dotnet run
On the first run of the Bot the configuration file will automatically be created by prompts on the command line. For a first test you only need to provide the Bot access token. The configuration will be stored in
/config/configuration.json
. Look at exampleconfig.json to see the structure of the config file if you wish to create it manually. -
Publish
To permanently run the bot you should publish it first:
dotnet publish -c Release --output published
Then you can create a daemon/service that automatically runs
dotnet published/MonkeyBot.dll
Here is an example for a system.d config file (tested on Ubuntu server):# /etc/systemd/system/MonkeyBot.service # To enable: sudo systemctl enable MonkeyBot.service # To start: sudo systemctl start MonkeyBot.service [Unit] Description=MonkeyBot service [Service] WorkingDirectory=/home/markus/MonkeyBot/published ExecStart=/usr/bin/dotnet /home/markus/MonkeyBot/published/MonkeyBot.dll Restart=on-failure RestartSec=10 SyslogIdentifier=monkeybot-service [Install] WantedBy=multi-user.target
Updates to new versions are then as easy as:
sudo systemctl stop MonkeyBot.service cd /home/markus/MonkeyBot git pull dotnet publish -c Release --output published sudo systemctl start MonkeyBot.service
Usage
Once the bot is running and connected it will respond to commands. Try !help to get you started.
Troubleshooting
Logfiles are stored in Logs
directory and fatal errors will also appear in the command line output. The SQLite database is located in the Data
directory.
If you have any questions or found a bug you can open an issue or get in touch on Discord
Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated. Have a look at our Contributing guidelines for more info.
tl;dr:
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request against the develop branch
License
Distributed under the MIT License. See LICENSE for more information.
Contact
Project Link: https://github.com/MarkusKgit/MonkeyBot
Discord: https://discord.gg/Ypdx2y7T2n
Acknowledgements
Features:
For a full list of commands see Commands