0.2.6 • Published 6 years ago

discordutility v0.2.6

Weekly downloads
27
License
ISC
Repository
-
Last release
6 years ago

DiscordUtility

DiscordUtility is an utility Package that provides features, such as:

  • An AntiSpam System
  • An advanced command handler
  • A checkCurse Function
  • A convertMS Function
  • A promptMessage Function

Installation

npm  i  discordutility

or if you use yarn

yarn  add  discordutility

Example

Handler:

const { Client } = require("discord.js");
const { Handler } = require("discordutility");
const bot = new Client();
bot.handler = new Handler(bot, { commandFolder: "commands", eventFolder: "events" }, "!").loadCommands().loadEvents();

checkCurse:

//Event Folder, message.js (events/message.js)
const { checkCurse } = require("discordutility");
module.exports = (bot, message) => {	
	if(checkCurse(message, true)) return message.reply("Do not swear >:(!");

	bot.handler.runCommand(message);
};
//Command Folder, help.js (commands/help.js)
module.exports = {
name:"help",
aliases: ["h"],
run: (bot, message, args) => {
		message.reply("Hello World!");
	}
}

AntiSpam:

const { Client } = require("discord.js");
const { AntiSpam } = require("discordutility");

const bot = new Client();
const antispam = new AntiSpam();

bot.on("message", async(message) => {
	if(!message.member) message.member = await message.guild.fetchMember(message.author);
	antispam.checkSpam(message);
})

Links

0.2.6

6 years ago

0.2.5

6 years ago

0.2.0

6 years ago

0.1.7

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

1.0.0

6 years ago