This repository has been archived on 2025-11-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
2021-08-11 17:58:14 +02:00
2021-08-07 16:14:40 +02:00
2021-06-24 16:21:21 +02:00
2021-08-11 17:32:05 +02:00
2021-07-06 21:14:36 +02:00
2021-07-06 21:14:36 +02:00
2021-08-08 16:34:52 +02:00
2021-06-19 18:35:14 +02:00
2021-08-11 17:58:14 +02:00
2021-07-06 21:14:36 +02:00
2021-07-06 21:14:36 +02:00
2021-08-07 16:14:40 +02:00
2021-08-08 01:41:04 +02:00

CommandBot

A Discord.js based framework that makes creating Discord bots easy and fast.

Table of contents

Installation

System requirements

  • Node.js 16.6.0 or newer
  • npm or yarn package manager

Creating a project

Registering Discord app

  1. Visit Discord Developer Portal and create an app
  2. Navigate to the Bot section and register a bot
  3. Navigate to OAuth 2 section, select bot and application.commands scopes and check bot permissions
  4. Copy the link and add your bot to the servers

Creating application

  1. Create empty directory
  2. Run npm init -y or yarn init -y
  3. Add the CommandBot package
// npm
npm install commandbot@latest

// yarn
yarn add commandbot@latest
  1. Create index.js file
  2. Import the CommandBot package
// CommonJS
const { Bot, Command } = require("commandbot");

// ES Modules (to use ESM add "type": "module" to your package.json file)
import { Bot, Command } from "commandbot";
  1. Initialize the bot instance
const bot = new Bot({
    name: "YOUR_BOT_NAME",
    prefix: "BOT_PREFIX", // bot prefix (optional) (if undefined, only slash commands will be available)
    argumentSeparator: ",", // used to separate parameters from messages (optional)
    clientOptions: {
        intents: [..."DISCORD_API_INTENTS"],
    }, // Discord.js ClientOptions (optional)
    token: "DISCORD_BOT_TOKEN", // Discord bot token
    applicationId: "APPLICATION_ID", // Discord application ID used to register slash commands
});

Links

  1. Create and add commands to the Bot instance (see Commands)
  2. Start your bot
bot.start(
    port, // If passed, the application will create a HTTP server
    true // If true, the app will register all slash commands in the Discord API (it's recommended setting it to false after registering to avoid reaching daily quota)
);

Commands

S
Description
Discord.js framework that helps you create your Discord bot. It includes full command system, automatically generated help command and command permission system.
Readme MIT
1.2 MiB
0 Stars 1 Watchers 0 Forks
2022-01-15 17:46:39 +01:00
Languages
TypeScript 99.8%
Shell 0.2%