nyx/commands/Giveaway/end.js
2021-06-24 15:53:19 +08:00

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(),
});
},
};