Skip to main content

Discord bot for any Nitrado game server

Project description

nidibot

Supported Versions PyPi Versions Code style: black License

Description

nidibot is a simple to install and configure bot for controlling your game servers from any messaging platform. Any is a bit of exaggeration here, since only Discord is supported.

nidibot name was derived from Nitrado, Discord and bot - game server provider and messaging platform for which this bot was written originally.

Commands

nidibot supports following commands:

/status [OPTIONAL:name]

Provides extended information about game server status.

/start [OPTIONAL:name]

Starts server if it is offline, restarts server if it is online.

/stop [OPTIONAL:name]

Stops server if it is online.

/restart [OPTIONAL:name]

Restarts server if it is online, starts server if it is offline.

/backup [OPTIONAL:name]

Creates backup of games server files and uploads them to storage. Backed up files are stored in the working folder of bot under backup folder.

Each command supports optional argument name. It is a convenience argument in case you have multiple game servers connected to the bot at once. In case if no name is specified, the command is applied to the first game server in the list.

Quick start

Prerequisites

You need to have following before you proceed with the instructions:

  1. Virtual machine (VM) or server somewhere in the Internet.
  2. Discord account (register or login at https://discord.com/).
  3. Any Discord server where you have access.
  4. Nitrado account (register or login at https://server.nitrado.net/en-GB/).
  5. Any game server that runs on Nitrado to which you have access.

Installation

  1. Login to your VM or server via SSH.
  2. Install Python 3.x. Do this only if Python 3.x is missing or very old. You don't need to have latest Python version for this bot.
  3. Install this bot as Python package via pip:
pip install nidibot
  1. Or upgrade already installed bot:
pip install nidibot --upgrade

Configuration

  1. Login to your VM or server via SSH.
  2. Create new folder for storing bot files.
  3. Proceed to the folder.
  4. Call following command for initializing bot in this folder and create default configuration files:
# Ubuntu/Linux only.
python3 -c 'from nidibot.nidibot import Nidibot; Nidibot.initialize_folder()'
  1. Following files should appear.
  2. Open bot_configuration.json file in any text editor and modify required values to your own:
{
    "bots": [
        {
            "type": "discord",
            "token": "your-discord-bot-token",
            "privileged_users": []
        }
    ],
    "server_providers": [
        {
            "type": "nitrado",
            "token": "your-gameserver-api-token"
        }
    ],
    "storage": {
        "type": "google-drive",
        "token": "your-storage-token"
    }
}
  1. Install nidibot service, so it will start automatically every system restart.
sudo cp nidibot.service /etc/systemd/system/nidibot.service && sudo systemctl daemon-reload && sudo systemctl enable nidibot.service
  1. Start newly installed service:
sudo systemctl start nidibot.service
  1. Check service status:
sudo systemctl status nidibot.service

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nidibot-1.1.1.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

nidibot-1.1.1-py2.py3-none-any.whl (16.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file nidibot-1.1.1.tar.gz.

File metadata

  • Download URL: nidibot-1.1.1.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for nidibot-1.1.1.tar.gz
Algorithm Hash digest
SHA256 d25c9d766da8e3cf037d8ef75250f07ca500da2eaae20c8dedfbcc4dc908d533
MD5 d6f76f62d2ca95d76ab6192b81ae801b
BLAKE2b-256 6742d1b00372940b033640fbf076851b87bd51a3c02bd1748af100f1a351319b

See more details on using hashes here.

File details

Details for the file nidibot-1.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: nidibot-1.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for nidibot-1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 37f659de921d5dcbd49bce8b4234907b8d1a7accc1bbb95cf43972b453c0beb5
MD5 23ff38dc23105da2cbe997530183d51b
BLAKE2b-256 58ed86729a0b96a65f89a85c0ed83b6c5d1305bf6411567841e3215408ed0c76

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page