nyx/commands/Giveaway/reroll.js

22 lines
656 B
JavaScript
Raw Normal View History

2021-06-12 12:53:51 +02:00
const { Client, Message, MessageEmbed } = require("discord.js");
module.exports = {
name: "reroll",
aliases: ["greroll"],
usage: "(Message ID)",
description: "Reroll a giveaway",
UserPerm: "MANAGE_MESSAGES",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
if (!args[0]) return client.err(message, "Giveaway", "reroll", 27);
const giveaway = client.giveaways.giveaways.find(
g => g.messageID === args[0]
);
if (!giveaway) return client.err(message, "Giveaway", "reroll", 26);
client.giveaways.reroll(giveaway.messageID);
},
};