Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.
/ MonkeyBot Public archive

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

License

Notifications You must be signed in to change notification settings

MarkusKgit/MonkeyBot

Repository files navigation

Build Status Contributors Issues MIT License Discord


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.

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)
  • (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

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

  1. Clone the repo

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

    or download it from GitHub and unzip it

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

  3. Build

    cd MonkeyBot
    dotnet build

    or open the solution in Visual Studio and build

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

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Languages