本文介紹了discord.js 用戶 ID avatarURL 嵌入的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我嘗試通過用戶 ID 顯示頭像,因為它希望如果我更改它,將顯示通過我的用戶 ID 在嵌入頁腳中加載的新頭像.有誰知道v12怎么樣?{need without message.author}
I trying display avatar via userID because it wants that if I changed it, the new one loaded via my user ID in footer in embed will be displayed. Anyone know how on v12? {need without message.author}
else if(isValidCommand(message, "embed")) {
let embedContent = message.content.substring(9);
let embed = new discord.MessageEmbed();
embed.addField('Message: ', embedContent);
embed.setColor('PURPLE');
embed.setAuthor(message.author.tag, message.author.avatarURL());
embed.setThumbnail( client.user.avatarURL());
embed.setTitle("Func title comming soon");
embed.setURL(``);
embed.setDescription("Func description comming soon");
embed.setImage(``);
embed.setTimestamp(Date.now());
embed.setFooter("? 2020 Dominik ~rejzer#9345 | link |", **[USERID .avatarURL or .displayAvatarURL]** );
message.channel.send(embed);
}
推薦答案
我希望你想把你的頭像放到嵌入的底部.所以使用以下內(nèi)容:
I hope you want to get your profile picture to the bottom of the embed. So use following:
bot.guilds.resolve(guildID).members.resolve(userID).user.avatarURL()
其中 bot 是您的客戶 (Discord.Client()
),guildID 是您所在的公會 ID,userID 是您的 ID(或您要顯示其頭像的用戶).
where bot is your client (Discord.Client()
), guildID is id of guild you're in and userID is your Id (or user you want to display profile picture of).
這篇關于discord.js 用戶 ID avatarURL 嵌入的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!