2023-03-23: The code hasn't been updated in quite a while and will probably break in the foreseeable future when the Discord API keeps changing. I don't have the time nor energy to keep working on this as it is rarely ever used. Feel free to fork it or take inspiration from it.
A general purpose Discord Bot for the Monkey Gamers community written in C#
Explore the available commands »
Join Chat
·
Report Bug
·
Request Feature
- About MonkeyBot
- Getting Started
- Usage
- Troubleshooting
- Roadmap
- Contributing
- License
- Contact
- Acknowledgements
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...
- .NET 7
- DSharpPlus
- nChronic
- CodeHollow.FeedReader
- Fluent Command Line Parser
- FluentScheduler
- Html Agility Pack
- Humanizer
- Microsoft.EntityFrameworkCore
- NCrontab
- NLog
- SQLite
- SteamQueryNet
- 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)
-
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
Once the bot is running and connected it will respond to commands. Try !help to get you started.
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
See the open issues for a list of proposed features (and known issues).
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
Distributed under the MIT License. See LICENSE for more information.
Project Link: https://github.com/MarkusKgit/MonkeyBot
Discord: https://discord.gg/Ypdx2y7T2n
For a full list of commands see Commands