@gary50613/discord.js-command-handler
Advanced tools
Comparing version 2.4.4 to 2.5.0
{ | ||
"name": "@gary50613/discord.js-command-handler", | ||
"version": "2.4.4", | ||
"version": "2.5.0", | ||
"description": "simple discord.js command handler", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -1,2 +0,2 @@ | ||
# djs-command-handler | ||
# discord.js-command-handler | ||
> Simple command handler for discord.js | ||
@@ -3,0 +3,0 @@ |
@@ -5,6 +5,5 @@ const Group = require("../base/Group") | ||
const Util = require("../Util") | ||
const EventHandler = require("../handler/EventHandler") | ||
const EventEmitter = require("events").EventEmitter | ||
class CommandManager extends EventEmitter { | ||
class CommandManager extends EventHandler { | ||
constructor(bot, options) { | ||
@@ -11,0 +10,0 @@ super() |
const Interaction = require("../base/Interaction") | ||
const InteractionHandler = require("../handler/InteractionHandler") | ||
const Util = require("../Util") | ||
const EventEmitter = require("events").EventEmitter | ||
const EventHandler = require("../handler/EventHandler") | ||
class InteractionManager extends EventEmitter { | ||
class InteractionManager extends EventHandler { | ||
@@ -8,0 +8,0 @@ constructor(bot, options) { |
import { Message, MessageEmbed, Client, PermissionResolvable, GuildMember, Guild } from "discord.js" | ||
import { EventEmitter } from "events" | ||
@@ -88,3 +87,8 @@ declare module "@gary50613/discord.js-command-handler" { | ||
declare class CommandManager extends EventEmitter { | ||
declare class EventHandler { | ||
public emit(name: string, ...args: any): void | ||
public removeListener(name: string, listener: void): void | ||
} | ||
declare class CommandManager extends EventHandler { | ||
public commands: Command[] | ||
@@ -111,6 +115,11 @@ public groups: Map<string, Group> | ||
public on(name: 'dm', listener: (message: Message) => void): this | ||
public on(name: 'ratelimit', listener: (time: number) => void): this | ||
public on(name: 'execute', listener: (command: Command, message: Message) => void): this | ||
public on(name: 'error' | 'promiseError', listener: (error: Error, command: Command, message: Message) => void): this | ||
public ratelimit?: RatelimitManager | ||
} | ||
declare class InteractionManager extends EventEmitter { | ||
declare class InteractionManager extends EventHandler { | ||
public interactions: Map<string, Interaction> | ||
@@ -122,2 +131,5 @@ public bot: Client | ||
public loadFolder(folderPath: string): void | ||
public on(name: 'execute', listener: (executor: Interaction, handler: InteractionHandler) => void): this | ||
public on(name: 'error' | 'promiseError', listener: (error: Error, executor: Interaction, handler: InteractionHandler) => void): this | ||
} | ||
@@ -133,2 +145,8 @@ | ||
export class Util{ | ||
public static isObject(o:any):boolean | ||
public static assignObject<K,T extends Object>(o:K,t:T):K | ||
public static loadFolder(fPath:string):Command[] | ||
} | ||
declare module "discord.js" { | ||
@@ -135,0 +153,0 @@ export interface Client { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29875
22
568