-
-
Save 5factor/4cb2e562bc8e3749077c96e738ec2234 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Client, Collection } from "discord.js"; | |
export class Command { | |
constructor(public client: Client, options) { | |
this.client = client; | |
this.help = { | |
name: options.name || null, | |
description: options.description || "No information specified.", | |
usage: options.usage || [], | |
}; | |
this.conf = { | |
permLevel: options.permLevel || 0, | |
cooldown: options.cooldown || 0, | |
aliases: options.aliases || [], | |
allowDMs: options.allowDMs || false, | |
args: options.args || | |
}; | |
this.cooldown = new Collection(); | |
} | |
setCategory(category) { | |
this.help.category = category; | |
} | |
startCooldown(guild, user) { | |
if (!this.cooldown.get(guild)) this.cooldown.set(guild, new Set()); | |
this.cooldown.get(guild).add(user); | |
setTimeout(() => { | |
this.cooldown.get(guild).delete(user); | |
}, this.conf.cooldown); | |
} | |
setMessage(message) { | |
this.message = message; | |
} | |
send(message) { | |
this.message.channel.send(message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment