data.poll.question[POLL_MEDIA_CONTENT_MISSING]: Poll media must include text, an attachment, an emoj

What am I doing wrong? Don't mind the would-you-rather question 😅
{
question: 'Would You Rather:',
answers: [
{ text: ' have your parents walk in on you making love' },
{ text: 'you on them' }
],
duration: 1,
allowMultiselect: false
}
{
question: 'Would You Rather:',
answers: [
{ text: ' have your parents walk in on you making love' },
{ text: 'you on them' }
],
duration: 1,
allowMultiselect: false
}
My code:
case 'would-you-rather' : {
let response;
try { response = await unirest.get(`https://api.truthordarebot.xyz/v1/wyr?rating=R`); }
catch (error) {
console.error(`[commands][games] ${error}`);
return showError(interaction);
};

if(!response.body.question) {
console.error(`[commands][games] Could not retrieve a question:\n${response.body}`);
return await showError(interaction);
};

const poll = {
question: "Would You Rather:",
answers: response.body.question.replace(/^Would you rather/i, '').split(/\s+(?:OR|or)\s+/i).map(option => { return { text: option.replace(/\?$/, '') } }),
duration: 1,
allowMultiselect: false
};

console.log(poll);

return await reply({ poll: poll }).catch(console.error);
}
case 'would-you-rather' : {
let response;
try { response = await unirest.get(`https://api.truthordarebot.xyz/v1/wyr?rating=R`); }
catch (error) {
console.error(`[commands][games] ${error}`);
return showError(interaction);
};

if(!response.body.question) {
console.error(`[commands][games] Could not retrieve a question:\n${response.body}`);
return await showError(interaction);
};

const poll = {
question: "Would You Rather:",
answers: response.body.question.replace(/^Would you rather/i, '').split(/\s+(?:OR|or)\s+/i).map(option => { return { text: option.replace(/\?$/, '') } }),
duration: 1,
allowMultiselect: false
};

console.log(poll);

return await reply({ poll: poll }).catch(console.error);
}
2 Replies
d.js toolkit
d.js toolkit8mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
AJ
AJOP8mo ago
wait question? oh ffs
Want results from more Discord servers?
Add your server