admin管理员组文章数量:1355047
I've been trying to show the server's icon in the serverinfo
embed, but it won't show up.
var serverIcon = message.guild.iconURL;
const serverInfoEmbed = new Discord.MessageEmbed()
.setTitle('server info')
.setColor(0x348a58)
.addField('owner', message.guild.owner, true)
.addField('name', '`' + message.guild.name + '`', true)
.addField('members', '`' + message.guild.memberCount + '`', true)
.setThumbnail(serverIcon)
.setFooter('very bootiful server');
setTimeout(() => { message.channel.send(serverInfoEmbed) }, 200);
console.log(serverIcon);
in the console, it says:
[Function: iconURL]
I tried to put it directly as the thumbnail .setThumbnail(message.guild.iconURL)
but it still didn't work.
I've been trying to show the server's icon in the serverinfo
embed, but it won't show up.
var serverIcon = message.guild.iconURL;
const serverInfoEmbed = new Discord.MessageEmbed()
.setTitle('server info')
.setColor(0x348a58)
.addField('owner', message.guild.owner, true)
.addField('name', '`' + message.guild.name + '`', true)
.addField('members', '`' + message.guild.memberCount + '`', true)
.setThumbnail(serverIcon)
.setFooter('very bootiful server');
setTimeout(() => { message.channel.send(serverInfoEmbed) }, 200);
console.log(serverIcon);
in the console, it says:
[Function: iconURL]
I tried to put it directly as the thumbnail .setThumbnail(message.guild.iconURL)
but it still didn't work.
1 Answer
Reset to default 5It's because guild.iconURL()
is a function, and you would need to replace your line :
var serverIcon = message.guild.iconURL;
with :
var serverIcon = message.guild.iconURL();
I also suggest you to read the docs for more info :)
本文标签: javascriptDiscordjsguildiconURL not working in embedStack Overflow
版权声明:本文标题:javascript - Discord.js | guild.iconURL not working in embed - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743957348a2568372.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论