nyx/commands/Giveaway/end.js

18 lines
572 B
JavaScript
Raw Normal View History

2021-06-12 12:53:51 +02:00
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(),
});
},
};