mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Animated emoji, npm fix
This commit is contained in:
@@ -8,12 +8,26 @@ module.exports = class EmojiListCommand extends Command {
|
||||
group: 'info',
|
||||
memberName: 'emoji-list',
|
||||
description: 'Responds with a list of the server\'s custom emoji.',
|
||||
guildOnly: true
|
||||
guildOnly: true,
|
||||
args: [
|
||||
{
|
||||
key: 'type',
|
||||
prompt: 'Would you like to view animated emoji or regular emoji?',
|
||||
type: 'string',
|
||||
default: 'regular',
|
||||
validate: type => {
|
||||
if (['animated', 'regular'].includes(type.toLowerCase())) return true;
|
||||
return 'Invalid type, please enter either animated or regular.';
|
||||
},
|
||||
parse: type => type.toLowerCase()
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
if (!msg.guild.emojis.size) return msg.say('This server has no custom emoji.');
|
||||
return msg.say(msg.guild.emojis.map(emoji => emoji.toString()).join(''));
|
||||
run(msg, { type }) {
|
||||
const emojis = msg.guild.emojis.filter(emoji => type === 'animated' ? emoji.animated : !emoji.animated);
|
||||
if (!emojis.size) return msg.say(`This server has no ${type} custom emoji.`);
|
||||
return msg.say(emojis.map(emoji => emoji.toString()).join(' '), { split: { char: ' ' } });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,8 +31,8 @@ module.exports = class EmojiInfoCommand extends Command {
|
||||
emoji.id, true)
|
||||
.addField('❯ Creation Date',
|
||||
emoji.createdAt.toDateString(), true)
|
||||
.addField('❯ External?',
|
||||
emoji.managed ? 'Yes' : 'No', true);
|
||||
.addField('❯ Animated?',
|
||||
emoji.animated ? 'Yes' : 'No', true);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -27,6 +27,7 @@ module.exports = class NPMCommand extends Command {
|
||||
async run(msg, { pkg }) {
|
||||
try {
|
||||
const { body } = await snekfetch.get(`https://registry.npmjs.com/${pkg}`);
|
||||
if (!body.time.unpublished) return msg.say('This package no longer exists.');
|
||||
const version = body.versions[body['dist-tags'].latest];
|
||||
const maintainers = trimArray(body.maintainers.map(user => user.name));
|
||||
const dependencies = version.dependencies ? trimArray(Object.keys(version.dependencies)) : null;
|
||||
|
||||
@@ -23,7 +23,7 @@ module.exports = class MockingCommand extends Command {
|
||||
|
||||
run(msg, { text }) {
|
||||
for (let i = 0; i < text.length; i += Math.floor(Math.random() * 4)) text[i] = text[i].toUpperCase();
|
||||
return msg.say(`${text.join('')} <:sponge:318612443398144000>`);
|
||||
return msg.say(`${text.join('')} <:sponge:390141884070363138>`);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "60.2.0",
|
||||
"version": "60.2.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ class EmojiArgumentType extends ArgumentType {
|
||||
}
|
||||
|
||||
validate(value, msg) {
|
||||
const matches = value.match(/^(?:<:([a-zA-Z0-9_]+):)?([0-9]+)>?$/);
|
||||
const matches = value.match(/^(?:<a?:([a-zA-Z0-9_]+):)?([0-9]+)>?$/);
|
||||
if (matches && msg.client.emojis.has(matches[2])) return true;
|
||||
if (!msg.guild) return false;
|
||||
const search = value.toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user