1.0.50 • Published 10 months ago

icytea-command-handler v1.0.50

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

icytea-command-handler

A small module used to handle commands using DiscordJS.

Usage

Initiate the module

To use this module, simply apply the code below.

Typesript:

import { CommandHandler } from "icytea-command-handler";

// Remember to put this code inside an async function.
await new CommandHandler(client, options).init();

Javascript/NodeJS:

const { CommandHandler } = require("icytea-command-handler");

// Remember to put this code inside an async function.
await new CommandHandler(client, options).init();

Creating a command

To create a command, look at this example. This package will utilize Discord's Slash commands. Please refer to DiscordJS Documentation or Official Discord Developers Documentation for more information on slash commands.

Typescript:

import { CommandTemplate } from "icytea-command-handler";

// Replace "Help" with the name of the command you like.
export default class Help extends CommandTemplate {
	constructor() {
		super({
			data: {
				name: "help",
				description: "The help command.",
			}, // Fill in basic data of the command.
			ownerOnly: false,
			userPermissions: [], // Sets the user's permissions
			clientPermissions: [], // Sets the client's permissions
			callback: ({
				interaction,
				client,
				guild,
				member,
				user,
				options,
				channel,
				handler,
			}) => {
				// Execute the command.
			},
		});
	}
}

Javascript/NodeJS:

const { CommandTemplate } = require("icytea-command-handler");

// Replace "Help" with the name of the command you like.
module.exports = class Help extends CommandTemplate {
	constructor() {
		super({
			data: {
				name: "help",
				description: "The help command.",
			}, // Fill in basic data of the command.
			ownerOnly: false,
			userPermissions: [], // Sets the user's permissions
			clientPermissions: [], // Sets the client's permissions
			callback: ({
				interaction,
				client,
				guild,
				member,
				user,
				options,
				channel,
				handler,
			}) => {
				// Execute the command.
			},
		});
	}
};

Creating a feature

To create a feature, simply use this code below.

Typescript:

import { FeatureTemplate } from "icytea-command-handler";

// Replace "Feature" with the name of the feature you like.
export default class Feature extends FeatureTemplate {
	public static shared = new Feature();

	public async init(client: Client): Promise<void>;
}

Javascript/NodeJS:

const { FeatureTemplate } = require("icytea-command-handler");

// Replace "Feature" with the name of the feature you like.
module.exports = class Feature extends FeatureTemplate {
	static shared = new Feature();

	async init(client) {}
};
1.0.22

12 months ago

1.0.21

12 months ago

1.0.26

10 months ago

1.0.25

10 months ago

1.0.24

10 months ago

1.0.23

10 months ago

1.0.29

10 months ago

1.0.28

10 months ago

1.0.27

10 months ago

1.0.33

10 months ago

1.0.32

10 months ago

1.0.31

10 months ago

1.0.30

10 months ago

1.0.37

10 months ago

1.0.36

10 months ago

1.0.35

10 months ago

1.0.34

10 months ago

1.0.39

10 months ago

1.0.38

10 months ago

1.0.40

10 months ago

1.0.44

10 months ago

1.0.43

10 months ago

1.0.42

10 months ago

1.0.41

10 months ago

1.0.48

10 months ago

1.0.47

10 months ago

1.0.46

10 months ago

1.0.45

10 months ago

1.0.49

10 months ago

1.0.50

10 months ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.20

1 year ago

1.0.16

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.6

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago