1.2.1 • Published 3 years ago

slashers v1.2.1

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

🎱 Slasher 🎱

Requires:

  • npm i discord.js@dev
  • node.js v14 or higher

Advantages:

  • Easy to use.
  • Good examples.
  • Makes your job easier.

📚 Getting Started:

Example of the main file with single dir:

const Discord = require('discord.js');
const slashers = require('slashers');
const client = new Discord.Client();

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

slashers.setPathSingle('path to slash folder', client)

client.on('interaction', async (interaction) => {
slashers.run(client, interaction);
});

client.login('token');

Example of the main file with subfolder dirs:

const Discord = require('discord.js');
const slashers = require('slashers');
const client = new Discord.Client();

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

slashers.setPathDirs('path to slash folder', client)

client.on('interaction', async (interaction) => {
slashers.run(client, interaction);
});

client.login('token');

Example of creating a very basic guild slash command using this package:

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
  slashers.createGlobal({
	  name: 'name',
	  description: 'description',
	  client: client,
  })
});

Example of creating a very basic global slash command using this package:

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
  slashers.createGuild({
	  guildId: 'guild id',
	  name: 'name',
	  description: 'description',
	  client: client,
  })
});

Example of creating a guild only slash command:

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
  const data = {
	name: 'ping',
	description: 'Replies with Pong!',
	};
    const command = await client.guilds.cache.get('guild id')?.commands.create(data);
});

Example of creating a global slash command:

⚠️️ These take 1 hour to apply! ⚠️

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
  const data = {
	name: 'ping',
	description: 'Replies with Pong!',
	};
    const command = await client.application?.commands.create(data);
});

Example of a slash command file:

module.exports = {
	name: 'ping',
	async run(interaction) {
	    interaction.reply("Pong!");
	},
};

Functions:

  • .setPathDirs - Set the path for slash commands with subfolders.
  • .setPathSingle - Set the path for slash commands without subfolders.
  • .run - Run a slash command file.
  • .createGuild - Create a basic guild slash command

Useful Links:

Discord Support Server

Discord.js Slash Commands Guide

1.2.0

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.2.1

3 years ago

1.1.5

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.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago