mirror of
https://github.com/hazemKrimi/discord-bot.git
synced 2026-05-01 18:30:25 +00:00
optimized volume and earrape commands
This commit is contained in:
@@ -11,7 +11,7 @@ module.exports = class Play extends Command {
|
|||||||
guildOnly: true,
|
guildOnly: true,
|
||||||
throttling: {
|
throttling: {
|
||||||
usages: 1,
|
usages: 1,
|
||||||
duration: 5
|
duration: 3
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -27,6 +27,7 @@ module.exports = class Play extends Command {
|
|||||||
return message.say({ embed });
|
return message.say({ embed });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
message.guild.music.volume = message.guild.music.sfx.earrape ? 1 : 10000;
|
||||||
message.guild.music.dispatcher.setVolume(message.guild.music.sfx.earrape ? 1 : 10000);
|
message.guild.music.dispatcher.setVolume(message.guild.music.sfx.earrape ? 1 : 10000);
|
||||||
message.guild.music.sfx.earrape = !message.guild.music.sfx.earrape;
|
message.guild.music.sfx.earrape = !message.guild.music.sfx.earrape;
|
||||||
const embed = new MessageEmbed().setColor('#000099').setTitle(`:loud_sound: Earrape ${message.guild.music.sfx.earrape ? 'on' : 'off'}`);
|
const embed = new MessageEmbed().setColor('#000099').setTitle(`:loud_sound: Earrape ${message.guild.music.sfx.earrape ? 'on' : 'off'}`);
|
||||||
@@ -34,7 +35,7 @@ module.exports = class Play extends Command {
|
|||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Error occured, if you are my creator please fix me soon');
|
const embed = new MessageEmbed().setColor('#ff0000').setTitle(`:x: Error occured: ${err.message}`);
|
||||||
return message.say({ embed });
|
return message.say({ embed });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ module.exports = class Play extends Command {
|
|||||||
guildOnly: true,
|
guildOnly: true,
|
||||||
throttling: {
|
throttling: {
|
||||||
usages: 1,
|
usages: 1,
|
||||||
duration: 5
|
duration: 3
|
||||||
},
|
},
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
key: 'query',
|
key: 'query',
|
||||||
prompt: 'specify the volume (greater than 0)',
|
prompt: 'specify the volume (greater than 0)',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
validate: query => query.length > 0 && parseInt(query) > 0
|
validate: query => query.length > 0 && parseInt(query) >= 0 && parseInt(query) <= 200
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
@@ -41,7 +41,7 @@ module.exports = class Play extends Command {
|
|||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Error occured, if you are my creator please fix me soon');
|
const embed = new MessageEmbed().setColor('#ff0000').setTitle(`:x: Error occured: ${err.message}`);
|
||||||
return message.say({ embed });
|
return message.say({ embed });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user