New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

goodbot

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

goodbot

an easy to use package for building discord bots

latest
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

GoodBot

GoodBot is a simple framework for building discord bots in JS.

Installation

Use the package manager npm to install goodbot.

npm install goodbot

Usage

To initialize the bot:

const { Client } = require("goodbot"); // importing goodbot
const path = require("path"); // importing path

const client = new Client({
  prefix: "!", // the bot's prefix
  ownerID: "465905397874688000", // your discord user id
  inviteLink: "https://discord.gg/botinvite", // the invite for your bot
  commandsFolder: path.join(__dirname, "commands"), // the commands folder, You need to make It
});

client.start("token"); // to start the bot with the token

To create Commands:

// to create commands You first need to make Categories
client.addCommandsCategory("name", "description"); // to create 1 category

// to create more than 1 categories at once
client.addCommandsCategories([
  ["moderation", "moderation commands"],
  ["music", "music commands"],
]);

// You need to create a folder inside the commandsFolder for each category

After that you need to make a file for the command inside one of the categories folders. Then to make the command write this in the command's file:

module.exports = {
  name: "ping", // command name
  description: "ping command description", // command description
  argsType: 'multiple', // not required
  // argsType set the 'args' parameter options,
  // 'single' => all the args in a single string
  // 'multiple' => all the args in a string array

  run: (client, message, args) => {
    message.channel.send("Pong!");
    // ...
  },
};

More

Default help command

To use the default help command:

client.createDefaultHelp();

Get a commandCategory

How to get a commandCategory:

client.commandsCategories.get('moderation');

Get a command

How to get a command:

client.commandsCategories.get('moderation').get('ban');

Keywords

discord

FAQs

Package last updated on 28 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts