A
A
anubis4652020-07-22 17:27:19
JavaScript
anubis465, 2020-07-22 17:27:19

Error after v12 update?

const Discord = require('discord.js');
module.exports.run = async (client, message, args) => {
    let hugUser = message.guild.member(message.mentions.users.first() || message.guild.member.get(args[0]));
    if (!hugUser) return message.reply('Укажите пожалуйста участника которого хотите обнять')

    let embed = new Discord.MessageEmbed()
    message.channel.send(`Круто!
    ${message.author.username} обнял ${hugUser.user.username}`)
    /*.setTitle("Круто!!")
    .setDescription(`${message.author.username} обнял ${hugUser.user.username}`)
    .setColor('#ffc0cb')*/
    var random = Math.floor(Math.random() * 3);
    message.channel.send({files: ["./обнял/" + random + ".jpg"]} )
    await message.channel.send(embed)
}

module.exports.help = {
    name: "обнять"
}


(node:8124) UnhandledPromiseRejectionWarning: TypeError: message.guild.member.get is not a function

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-07-22
@anubis465

message.guild.member.getuse insteadmessage.guild.member.cache.get

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question