17 lines
572 B
JavaScript
17 lines
572 B
JavaScript
const { Client, Message, MessageEmbed } = require("discord.js");
|
|
module.exports = {
|
|
name: "gend",
|
|
UserPerm: "MANAGE_MESSAGES",
|
|
usage: "(Message ID)",
|
|
description: "End a giveaway",
|
|
run: async (client, message, args) => {
|
|
if (!args[0]) return client.err(message, "Giveaway", "end", 27);
|
|
const giveaway = client.giveaways.giveaways.find(
|
|
g => g.messageID === args.join(" ")
|
|
);
|
|
if (!giveaway) return client.err(message, "Giveaway", "end", 26);
|
|
client.giveaways.edit(giveaway.messageID, {
|
|
setEndTimestamp: Date.now(),
|
|
});
|
|
},
|
|
};
|