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 .setTitle("Круто!!")
.setDescription(`${message.author.username} обнял ${hugUser.user.username}`)
.setColor('#ffc0cb')
const Discord = require('discord.js');
module.exports.run = async (client, message, args) => {
let hugUser = message.guild.member(message.mentions.users.first() || message.guild.members.cache.get(args[1]));
if (!hugUser) return message.reply('Укажите пожалуйста участника которого хотите обнять')
var random = Math.floor(Math.random() * 3);
var random_image = message.channel.send({files: ["./обнял/" + random + ".jpg"]} )
let embed = new Discord.MessageEmbed()
/*message.channel.send(`Круто!
${message.author.username} обнял ${hugUser.user.username}`)*/
.setTitle("Круто!!")
.setDescription(`${message.author.username} обнял ${hugUser.user.username}`)
.setColor('#ffc0cb')
.addFields(
{ name: 'Картинка', value: random_image }
);
/*var random = Math.floor(Math.random() * 3);
message.channel.send({files: ["./обнял/" + random + ".jpg"]} )*/
await message.channel.send(embed)
}
module.exports.help = {
name: "обнять"
}
var random_image = message.channel.send({files: ["./обнял/" + random + ".jpg"]} ).setImage(random_image)
var random = Math.floor(Math.random() * 3);
const exampleEmbed = new Discord.MessageEmbed()
.setTitle('Картинка')
.attachFiles(["./обнял/" + random + ".png"])
.setImage(`attachment://${random}.png`);
message.channel.send(exampleEmbed) (node:11532) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat 'C:\Users\yande\Desktop\Аристо\обнял\0.png'
(node:11532) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)const Discord = require('discord.js');
module.exports.run = async (client, message, args) => {
let hugUser = message.guild.member(message.mentions.users.first() || message.guild.members.cache.get(args[1]));
if (!hugUser) return message.reply('Укажите пожалуйста участника которого хотите обнять')
var random = Math.floor(Math.random() * 3);
let embed = new Discord.MessageEmbed()
const exampleEmbed = new Discord.MessageEmbed()
.setTitle("Круто!!")
.setDescription(`<@${message.author.id}> обнял <@${hugUser.user.id}>`)
.setColor('#ffc0cb')
.attachFiles(["./обнял/" + random + ".png"])
.setImage(`attachment://${random}.png`);
await message.channel.send(embed)
}
module.exports.help = {
name: "обнять"
}