mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 14:00:22 +02:00
Require MOVE_MEMBERS for voice commands
This commit is contained in:
@@ -20,6 +20,9 @@ module.exports = class LeaveCommand extends Command {
|
|||||||
const usage = this.client.registry.commands.get('stop').usage();
|
const usage = this.client.registry.commands.get('stop').usage();
|
||||||
return msg.reply(`I am currently playing audio in this server. Please use ${usage} first.`);
|
return msg.reply(`I am currently playing audio in this server. Please use ${usage} first.`);
|
||||||
}
|
}
|
||||||
|
if (!connection.channel.permissionsFor(msg.author).has('MOVE_MEMBERS')) {
|
||||||
|
return msg.reply(`You need the "MOVE_MEMBERS" permission to use the \`${this.name}\` command.`);
|
||||||
|
}
|
||||||
connection.leave();
|
connection.leave();
|
||||||
return msg.reply(`Left **${connection.channel.name}**...`);
|
return msg.reply(`Left **${connection.channel.name}**...`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ module.exports = class PauseCommand extends Command {
|
|||||||
if (connection.canPlay) {
|
if (connection.canPlay) {
|
||||||
return msg.reply('I am not currently playing audio in this server.');
|
return msg.reply('I am not currently playing audio in this server.');
|
||||||
}
|
}
|
||||||
|
if (!connection.channel.permissionsFor(msg.author).has('MOVE_MEMBERS')) {
|
||||||
|
return msg.reply(`You need the "MOVE_MEMBERS" permission to use the \`${this.name}\` command.`);
|
||||||
|
}
|
||||||
connection.pause();
|
connection.pause();
|
||||||
return msg.reply('Paused playing.');
|
return msg.reply('Paused playing.');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ module.exports = class ResumeCommand extends Command {
|
|||||||
if (connection.canPlay) {
|
if (connection.canPlay) {
|
||||||
return msg.reply('I am not currently playing audio in this server.');
|
return msg.reply('I am not currently playing audio in this server.');
|
||||||
}
|
}
|
||||||
|
if (!connection.channel.permissionsFor(msg.author).has('MOVE_MEMBERS')) {
|
||||||
|
return msg.reply(`You need the "MOVE_MEMBERS" permission to use the \`${this.name}\` command.`);
|
||||||
|
}
|
||||||
connection.unpause();
|
connection.unpause();
|
||||||
return msg.reply('Resumed playing.');
|
return msg.reply('Resumed playing.');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ module.exports = class StopCommand extends Command {
|
|||||||
if (connection.canPlay) {
|
if (connection.canPlay) {
|
||||||
return msg.reply('I am not currently playing audio in this server.');
|
return msg.reply('I am not currently playing audio in this server.');
|
||||||
}
|
}
|
||||||
|
if (!connection.channel.permissionsFor(msg.author).has('MOVE_MEMBERS')) {
|
||||||
|
return msg.reply(`You need the "MOVE_MEMBERS" permission to use the \`${this.name}\` command.`);
|
||||||
|
}
|
||||||
connection.stop();
|
connection.stop();
|
||||||
return msg.reply('Stopped playing.');
|
return msg.reply('Stopped playing.');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user