mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Server Icon Command
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
|
||||
module.exports = class ServerIconCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'server-icon',
|
||||
aliases: ['guild-icon', 's-icon', 'g-icon'],
|
||||
group: 'info',
|
||||
memberName: 'server-icon',
|
||||
description: 'Responds with the server\'s icon.',
|
||||
guildOnly: true,
|
||||
clientPermissions: ['EMBED_LINKS']
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
if (!msg.guild.icon) return msg.reply('This server has no icon.');
|
||||
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()
|
||||
.setTitle(msg.guild.name)
|
||||
.setDescription(
|
||||
formats.map(fmt => embedURL(displayFmts[fmt], msg.guild.iconURL({ format: fmt, size: 2048 }))).join(' | ')
|
||||
)
|
||||
.setImage(msg.guild.iconURL({ format, size: 2048 }))
|
||||
.setColor(0x00AE86);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "134.5.0",
|
||||
"version": "134.6.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user