Preparations
info
We expect you to already have a working installation of Deno 1.28+ or Node.js 18+
Setting up your project
Dependencies
- Deno
- Node
Start by creating a deno.json
file in your project directory:
{
"importMap": "import_map.json"
}
Then create an import_map.json
file in the same directory:
{
"imports": {
"disploy": "npm:disploy@dev",
"std/": "https://deno.land/std@0.164.0/",
"fmt/": "https://deno.land/std@0.164.0/fmt/"
}
}
This will allow you to import Disploy from the disploy
module.
We are also importing the standard library from Deno's official repository.
You can initialize a Node.js project with the following command:
npm init -y
# or
yarn init -y
# or
pnpm init -y
Then install Disploy, dotenv and express since we will be using them in this guide:
npm install disploy dotenv express
# or
yarn add disploy dotenv express
# or
pnpm add disploy dotenv express
Creating a .env
Create a .env
file in your project directory and add the following content:
DISCORD_CLIENT_ID="Your Discord bot's client id"
DISCORD_TOKEN="Your Discord bot's token"
DISCORD_PUBLIC_KEY="Your Discord's bot's public key"
You can find all of these values in your Discord Developer Portal.