2.0.0 • Published 3 years ago

slashcord v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Logo

Installation

Node.js 16.6.0 or newer is required

# With NPM
npm install slashcord
# Alternatively, with yarn
yarn add slashcord

Setup

When using Slashcord, require it using the following ways:

// Using CommonJS
const Slashcord = require("slashcord");
// With ESM
import Slashcord from "slashcord";

You can use this example provided below:

// You can use CommonJS for this example
import Slashcord from "slashcord";
import { Client, Intents } from "discord.js";

const client = new Client({ intents: [Intents.FLAGS.GUILD_MESSAGES] });

client.on("ready", () => {
  console.log("Ready!");
  new Slashcord(client, {
    commandsDir: "commands",
  });
});

client.login("super secret token");

Creating A Command

Creating a command with Slashcord is rather simple, you can do in 2 ways.

Easy Way

const slash = new Slashcord(client, {
  commandsDir: "commands",
});

// Keep in mind, there must be an async function of some sort.
await slash.create({
  name: "ping",
  description: "ping? what else.",
  args: [],
  guildId: "optional",
  type: "CHAT_INPUT",
});

Let's go over our parameters:

Name ➜ The name of the slash command REQUIRED

Description ➜ The description of the slash command REQUIRED

Options ➜ The options of the slash command OPTIONAL

Guild ID ➜ The guild ID for the slash command OPTIONAL

Complex Way

/* Somewhere in your commands folder
 * Name: "ping.js"
 * NOTE: the file name is the command name, but you can configure it.
 */

module.exports = {
  // name: "ping",
  description: "Simple pong?",
  execute: ({ interaction, args, client }) => {
    interaction.reply("Pong!");
  },
};

Everything else can be found on the guide that discord.js made!

https://discord.io/mystiing

2.0.0

3 years ago

1.7.5

3 years ago

1.7.4

3 years ago

1.7.3

3 years ago

1.7.2

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.4.6

3 years ago

1.4.4

3 years ago

1.3.5

3 years ago

1.4.3

3 years ago

1.3.4

3 years ago

1.4.2

3 years ago

1.3.3

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago