|
|
@ -49,6 +49,7 @@ class command
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.name = options.name;
|
|
|
|
this.name = options.name;
|
|
|
|
this.aliases = options.aliases;
|
|
|
|
this.aliases = options.aliases;
|
|
|
|
|
|
|
|
this.group = options.group;
|
|
|
|
this.description = options.description;
|
|
|
|
this.description = options.description;
|
|
|
|
this.needsAdmin =options.needsAdmin;
|
|
|
|
this.needsAdmin =options.needsAdmin;
|
|
|
|
this.hidden = options.hidden;
|
|
|
|
this.hidden = options.hidden;
|
|
|
@ -74,9 +75,9 @@ class _Client extends Client
|
|
|
|
if(typeof command === 'function')
|
|
|
|
if(typeof command === 'function')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let c = new command(this);
|
|
|
|
let c = new command(this);
|
|
|
|
|
|
|
|
|
|
|
|
this.commands.set(c.name,{
|
|
|
|
this.commands.set(c.name,{
|
|
|
|
needsAdmin: c.needsAdmin?c.needsAdmin:false,
|
|
|
|
needsAdmin: c.needsAdmin?c.needsAdmin:false,
|
|
|
|
|
|
|
|
group: c.group,
|
|
|
|
command: command,
|
|
|
|
command: command,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if(c.aliases)
|
|
|
|
if(c.aliases)
|
|
|
@ -85,6 +86,7 @@ class _Client extends Client
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.commands.set(c.aliases[i],{
|
|
|
|
this.commands.set(c.aliases[i],{
|
|
|
|
needsAdmin: c.needsAdmin,
|
|
|
|
needsAdmin: c.needsAdmin,
|
|
|
|
|
|
|
|
group: c.group,
|
|
|
|
command: command,
|
|
|
|
command: command,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -186,7 +188,7 @@ class _Client extends Client
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
async enableCommands()
|
|
|
|
async enableCommands()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.on("messageCreate", message=>
|
|
|
|
this.on("messageCreate", async (message)=>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.checkForInvites(message);
|
|
|
|
this.checkForInvites(message);
|
|
|
|
if(message.content.startsWith(process.env.prefix)) //Test prefix t!
|
|
|
|
if(message.content.startsWith(process.env.prefix)) //Test prefix t!
|
|
|
@ -202,7 +204,8 @@ class _Client extends Client
|
|
|
|
let isMusicRelated = this.commands.get(commandName).group == 'music';
|
|
|
|
let isMusicRelated = this.commands.get(commandName).group == 'music';
|
|
|
|
if(isMusicRelated)
|
|
|
|
if(isMusicRelated)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!this.getMusicActive(message.guildId)) return new ErrorMessage(this).send(ErrorType.FeatureInnactive, message);
|
|
|
|
let isActive = await this.getMusicActive(message.guildId);
|
|
|
|
|
|
|
|
if(!isActive) return new ErrorMessage(this).send(ErrorType.FeatureInnactive, message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let isAdmin =false;
|
|
|
|
let isAdmin =false;
|
|
|
|
try
|
|
|
|
try
|
|
|
|