mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 00:06:42 +02:00
Remove discriminator command
This commit is contained in:
@@ -132,7 +132,7 @@ in the appropriate channel's topic to use it.
|
||||
|
||||
## Commands
|
||||
|
||||
Total: 385
|
||||
Total: 384
|
||||
|
||||
### Utility:
|
||||
|
||||
@@ -154,7 +154,6 @@ Total: 385
|
||||
|
||||
* **avatar:** Responds with a user's avatar.
|
||||
* **channel:** Responds with detailed information on a channel.
|
||||
* **discriminator:** Searches for other users with a certain discriminator.
|
||||
* **emoji-image:** Responds with an emoji's full-scale image.
|
||||
* **emoji-list:** Responds with a list of the server's custom emoji.
|
||||
* **emoji:** Responds with detailed information on an emoji.
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const { trimArray } = require('../../util/Util');
|
||||
|
||||
module.exports = class DiscriminatorCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'discriminator',
|
||||
aliases: ['discrim', 'search-discrim', 'search-discriminator'],
|
||||
group: 'info',
|
||||
memberName: 'discriminator',
|
||||
description: 'Searches for other users with a certain discriminator.',
|
||||
args: [
|
||||
{
|
||||
key: 'discrim',
|
||||
label: 'discriminator',
|
||||
prompt: 'Which discriminator would you like to search for?',
|
||||
type: 'string',
|
||||
default: msg => msg.author.discriminator,
|
||||
validate: discrim => {
|
||||
if (/^[0-9]+$/.test(discrim) && discrim.length === 4) return true;
|
||||
return 'Invalid discriminator.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { discrim }) {
|
||||
const users = this.client.users.cache
|
||||
.filter(user => user.discriminator === discrim)
|
||||
.map(user => user.username);
|
||||
return msg.say(stripIndents`
|
||||
**Found ${users.length} users with the discriminator #${discrim}:**
|
||||
${trimArray(users, 50).join(', ')}
|
||||
`);
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "112.22.0",
|
||||
"version": "113.0.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user