F
F
FlipSize2021-09-10 16:36:06
Node.js
FlipSize, 2021-09-10 16:36:06

How to use guild in a function?

I am new to learning javascript.

How can i use this

msg.guild.iconURL({dynamic:`gif`})
in an embed message right here.

const { MessageEmbed } = require('discord.js');

const Color = {
  info: '#131313',
  warn: 'YELLOW',
  error: 'RED',
};

function CreateEmbed(color, message) {
  const embed = new MessageEmbed()
    .setColor(Color[color])
    .setFooter(`BlackSun — Official server`);
  if (message) embed.setDescription(message);
  return embed;
}

module.exports = { CreateEmbed };

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AlmondPark33609, 2021-10-11
@AlmondPark33609

Use {format} and not {dynamic}

let emb = new MessageEmbed()
.setDescription('Иконка сервера')
.setImage(message.guild.iconURL({format: 'формат'})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question