gpt4 book ai didi

javascript - 小 discord.js 头像图像

转载 作者:行者123 更新时间:2023-12-02 02:34:10 27 4
gpt4 key购买 nike

头像问题示例

enter image description here

我正在尝试执行 discord.js avatar 命令并且它有效。它发送它需要发送的图像,但问题是发送的图像与其他机器人相比较小。我正在使用 discord.js 指南中的命令处理程序

const Discord = require('discord.js');
module.exports = {
name: 'avatar',
description: 'Get the avatar URL of the tagged user(s), or your own avatar.',
aliases: ['av', 'a'],
usage: '[commandname]',
cooldown: 10,
execute(message) {
if (!message.mentions.users.size) {
const embed = new Discord.MessageEmbed()
.setTitle(message.author.username)
.setColor(0x00ffff)
.setImage(message.author.displayAvatarURL({ format: 'png' }));
return message.channel.send(embed);
}

const mention = message.mentions.members.first();
const Embed = new Discord.MessageEmbed()
.setTitle(message.mentions.users.first().username)
.setColor(0x00ffff)
.setImage(mention.user.displayAvatarURL({ format: 'png' }));
return message.channel.send(Embed);

},
};

最佳答案

您可以添加一个大小选项,就像您对格式所做的那样

.displayAvatarURL({ format: 'png', size: size_you_want }));

大小为以下 16、32、64、128、256、512、1024、2048、4096 之一,有关更多信息,您可以在此处查看选项 https://discord.js.org/#/docs/main/stable/typedef/ImageURLOptions

关于javascript - 小 discord.js 头像图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64566200/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com