mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-16 00:12:32 +02:00
Discord.js v14
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder, PermissionFlagsBits } = require('discord.js');
|
||||
const { embedURL } = require('../../util/Util');
|
||||
const displayFmts = {
|
||||
jpg: 'JPEG',
|
||||
@@ -17,7 +17,7 @@ module.exports = class ServerIconCommand extends Command {
|
||||
memberName: 'server-icon',
|
||||
description: 'Responds with the server\'s icon.',
|
||||
guildOnly: true,
|
||||
clientPermissions: ['EMBED_LINKS']
|
||||
clientPermissions: [PermissionFlagsBits.EmbedLinks]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -26,10 +26,10 @@ module.exports = class ServerIconCommand extends Command {
|
||||
const formats = ['png', 'jpg', 'webp'];
|
||||
const format = msg.guild.icon && msg.guild.icon.startsWith('a_') ? 'gif' : 'png';
|
||||
if (format === 'gif') formats.push('gif');
|
||||
const embed = new MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(msg.guild.name)
|
||||
.setDescription(
|
||||
formats.map(fmt => embedURL(displayFmts[fmt], msg.guild.iconURL({ format: fmt, size: 2048 }))).join(' | ')
|
||||
formats.map(fmt => embedURL(displayFmts[fmt], msg.guild.iconURL({ extension: fmt, size: 2048 }))).join(' | ')
|
||||
)
|
||||
.setImage(msg.guild.iconURL({ format, size: 2048 }))
|
||||
.setColor(0x00AE86);
|
||||
|
||||
Reference in New Issue
Block a user