I wanted to make a poll command but I can't get it to send a message to a specific channel This is my code:
const { tprefix, pollchannel } = require('../config.json');
const Discord = require('discord.js');
const client = new Discord.Client();
module.exports = {
name: 'poll',
description: 'can make polls',
cooldown: 5,
usage: '[ask] [emoji1] [emoji 2]',
aliases: ['createpoll'],
async execute(message) {
const channel = message.client.channels.fetch(pollchannel);
message.channel.send('you have 60 seconds.');
// await new Promise((resolve) => setTimeout(resolve, 60000));
channel.client.send(`${tprefix} message`);
message.channel.send('finished');
},
};
It should send a message with "you have 60 seconds.", then wait 60 seconds and then send a message in the poll channel and on the current channel. The channel id is correct and written down in the config.json