This document illustrates the process of creating a Discord Bot using the Nova platform.
Credentials should always be private.
The example Bot executes ping
s (ICMP Echo) requests using Application Commands,
also known as Slash Commands.
Configuration is done by creating a file inside the config directory. The file should be named "default", we support TOML, JSON (and JSON5) and YAML.
Make sure to configure properly your instance before getting started, see the example file in the directory for more information.
You need to install Nova.
For simplicity we will use the all-on-one
distribution, which provides a single binary.
This is usesul in development environments.
To make it simplier we publish a simple utility package which download the binary.
To get the most out of Nova, we strongly encourages you to deploy Nova correctly (as microservices), on the orchestrator you want (Kubernetes, Docker Compose...). The all-in-one distribution IS NOT MADE for production environments.
The next step is starting nova:
npm run nova
This example uses Node.js and TypeScript.
You need to Install Node.js.
Then you simply run npm install
to install the required dependencies.
Application Commands need to be registered to Discord ahead-of-run. This usually is a one-time operation. This step is thus optional if you already have registered the commands.
The register.ts
utility does the job for you.
npm run register
To start the Bot and make it connect to the Nova Gateway, run the following:
# Using npm
npm run start
Everything should be running now!