nyx/commands/Utilities/poll.js

25 lines
861 B
JavaScript
Raw Normal View History

2021-07-13 05:17:39 +02:00
const { MessageEmbed } = require("discord.js");
2021-06-12 12:53:51 +02:00
module.exports = {
name: "poll",
2021-07-13 05:17:39 +02:00
description: "Start a poll in a channel",
2021-06-12 12:53:51 +02:00
category: "Utilities",
2021-07-13 05:17:39 +02:00
Owner: true,
2021-06-12 12:53:51 +02:00
run: async (client, message, args) => {
2021-07-13 05:17:39 +02:00
let pollDescription = `
${message.author} asks: ${args.slice(1).join(" ")}
`;
const channel = message.mentions.channels.first();
if (!channel) return client.err(message, "Utilities", "poll", 28);
if (!pollDescription) return client.err(message, "Utilities", "poll", 12);
let embedPoll = new MessageEmbed()
.setTitle(`${message.author.username} made a poll`)
.setDescription(pollDescription)
.setFooter(`Made by ${client.author}`)
.setTimestamp()
.setColor("GREEN");
let msgEmbed = await channel.send(embedPoll);
await msgEmbed.react("👍");
await msgEmbed.react("👎");
2021-06-12 12:53:51 +02:00
},
};