There are 2 ways to create a new bot, through the Controller App or through the Blitz CLI.

CLI Command

Terminal
blitz bot

You can also pass in options to bypass manual tasks such as setting the bots token.

Flags

-t
string

Your bots token to place inside the .env file

Controller App

Create a bot from the homepage of the controller app.

1

Open Create Dialoge

Click “Create New Bot” button on the homepage.

2

Set Bot Name

Enter bot local name (name for the folder on your local device).

3

Set Bot Token

Enter the bots token to place inside the .env file.

4

Finish

Click “Create Bot” to create the files.

Files

Structure

Your bot should have a similar structure to this.

File Structure
├── deno.json
├── bot.ts
├── .env
└── /plugins

Uses

deno.json

Used to init a new Deno project.

bot.ts

Contains the code to load your bot and the plugins.

.env

Stores your discord bot token as an environment variable.

/plugins

Holds all of the plugins you install onto a bot.

Class Props

You can add more config options into the Bot Class.

Custom Intents

Bot.ts
const customIntents = [
  IntentsBitField.Flags.Guilds,
  IntentsBitField.Flags.GuildMessages,
];

const bot = new Bot({ token: token, intents: customIntents });
bot.start();

Custom Plugin Directory

Bot.ts
const bot = new Bot({ token: token, pluginsDir: "./custom_plugins" });
bot.start();

Load Command In A Single Guild

Bot.ts
const bot = new Bot({ token: token, server: "123456789101112" });
bot.start();