mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 13:56:43 +02:00
Add verification
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
|
const { verify } = require('../../util/Util');
|
||||||
|
|
||||||
module.exports = class RenameAllCommand extends Command {
|
module.exports = class RenameAllCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -30,6 +31,11 @@ module.exports = class RenameAllCommand extends Command {
|
|||||||
|
|
||||||
async run(msg, { nickname }) {
|
async run(msg, { nickname }) {
|
||||||
try {
|
try {
|
||||||
|
await msg.reply(
|
||||||
|
`Are you sure you want to ${nickname ? `rename everyone to **${nickname}**` : 'remove all nicknames'}?`
|
||||||
|
);
|
||||||
|
const verification = await verify(msg.channel, msg.author);
|
||||||
|
if (!verification) return msg.say('Aborted.');
|
||||||
await msg.reply('Fetching members...');
|
await msg.reply('Fetching members...');
|
||||||
await msg.guild.members.fetch();
|
await msg.guild.members.fetch();
|
||||||
await msg.reply('Fetched members! Renaming...');
|
await msg.reply('Fetched members! Renaming...');
|
||||||
|
|||||||
Reference in New Issue
Block a user