1
0
Fork 0
mirror of https://github.com/1disk/edp445.git synced 2024-08-14 22:47:02 +00:00
edp445/functions/cmd-poll.js
2022-11-26 15:27:07 +01:00

19 lines
No EOL
688 B
JavaScript

const Discord = require('discord.js') //Import Discord API
require('discord-inline-reply'); //Import inline replies for Discord API
const fetch = require('node-fetch'); //Import the FETCH API
module.exports = async (message, author, guild, client) => {
var pollcontent = message.content.replace(`<@${client.user.id}>`, '')
pollcontent = pollcontent.replace("cmd poll", '')
message.channel.send(`**:speech_left: ${pollcontent}**\n👤 ${author}`).then(m => {
try {
m.react("👍🏻")
m.react("👎🏻")
} catch (err) {
return message.channel.send("I can't react to messages 💀")
}
})
message.delete()
}