Skip to content

MK31973/MonkeyBot

 
 

Repository files navigation

Build Status Contributors Issues MIT License Discord


Logo

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

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) including our own Forums and Website
  • (Self) role assignments
  • Scheduled announcements
  • Game server tracking
  • Silly stuff like Trivia, Chuck Norris jokes, Benzen Facts, xkcd...

Built With

Getting Started

Prerequisites

  • Latest .NET core SDK for your platform (3.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: A cloudinary API key (only required for the Minecraft server status image). You can register one here
  • Optional: An IDE of your choice (Visual Studio 2019 recommended)

Installation

  1. Clone the repo

    git clone https://github.com/MarkusKgit/MonkeyBot.git

    or download it from GitHub and unzip it

  2. Build

    cd MonkeyBot
    dotnet build

    or open the solution in Visual Studio and build

  3. 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.

  4. 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:

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Project Link: https://github.com/MarkusKgit/MonkeyBot

Discord: https://discord.gg/u43XvME

Acknowledgements

Features:

For a full list of commands see Commands

About

General purpose C# Discord Bot written for the Monkey Gamers Community

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%