Skip to content

A simple example discord bot powered by Nova that issues pings

License

Notifications You must be signed in to change notification settings

discordnova/nova-quickstart

Repository files navigation

Nova quickstart

This document illustrates the process of creating a Discord Bot using the Nova platform.

Credentials should always be private.

An example of a Ping command, calculating the latency in a local network.

What you'll be doing

The example Bot executes pings (ICMP Echo) requests using Application Commands, also known as Slash Commands.

Getting Started

Configuring the Bot

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.

Starting the Bot

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

Installing Node Dependencies

This example uses Node.js and TypeScript.

You need to Install Node.js. Then you simply run npm install to install the required dependencies.

Registering Commands

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

Starting the bot

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!

About

A simple example discord bot powered by Nova that issues pings

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published