Sign In

Installation

Install ForgeScript and run your first Discord bot.

Prerequisites

You need Node.js 22+ installed on your system and a bot token from the Discord Developer Portal.

Quick Start

Install ForgeScript

Add @tryforge/forgescript to your project using your preferred package manager:

npm install @tryforge/forgescript

Create your entry file

Create an index.js file in your project directory and set up ForgeClient:

const { ForgeClient } = require("@tryforge/forgescript")

const client = new ForgeClient({
  intents: ["Guilds", "GuildMessages", "MessageContent"],
  events: ["messageCreate", "interactionCreate"],
  prefixes: ["!"],
})

client.commands.add({
  type: "messageCreate",
  name: "ping",
  code: `$ping ms`,
})

client.login("YOUR_BOT_TOKEN")

Start the bot

Run your script in your terminal:

node index.js