Closed Simomagy closed 1 year ago
Yeah, from the member object of a user https://discord.js.org/#/docs/discord.js/v13/class/GuildMember
specifically member.displayAvatarURL({ format: "png" })
Ho provato a farlo ma richiede node.js per forza o c'è un altro modo?
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
const player = discordID
const avatarUrl = player.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 });
console.log(`ID del giocatore: ${discordID}`);
console.log(`URL dell'avatar: ${avatarUrl}`);
client.login('token');
}
zdiscord uses nodejs under the hood. you don't need all the client.
stuff. If you use zdiscord and have it fully setup then you can add to the end of the server.js file ( https://github.com/zfbx/zdiscord/blob/djs/server/server.js ) with the following code
global.exports("getPicture", (identifier) => {
const member = z.bot.parseMember(identifier);
return member.displayAvatarURL({ format: "png" }) || "";
});
and use it in any other resource server side with the following exports
-- in a lua script
local picture = exports.zdiscord:getPicture(source);
Is it possible to make an export to get the Discord profile picture of a user?