Отправить не определено (предложить команду) - PullRequest
1 голос
/ 26 апреля 2020

TypeError: Cannot read property 'send' of undefined Что я сделал не так? Я не понимаю, где я должен это определить. Наверное, просто глупость, которую я забыл. Буду признателен за все улучшения / предложения.

module.exports = {
    name: 'suggest',
    aliases: ['sug', 'suggestion'],
    description: 'Suggest something for the Bot',
    execute( client, message, args) {
        const filter = m => m.author.id === message.author.id;
        message.channel.send(Suggest something for the Bot or send "cancel" to cancel the suggestion)
        message.channel.awaitMessages(filter, {max: 1,})
            .then(async(collected) => {
                if (collected.first().content.toLowerCase() == 'cancel') {
                message.reply("The suggestion has been cancelled.")
                } 
                else { client.channels.get("702825446248808519").send(collected.first().content)
                    message.channel.send(Your suggestion has been sent)
                }
            })
    },
    catch (err) {
        console.log(err)
    }
};
...