mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 21:40:51 +02:00
Allow mentions
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
|
const { User } = require('discord.js');
|
||||||
const { MersenneTwister19937, integer } = require('random-js');
|
const { MersenneTwister19937, integer } = require('random-js');
|
||||||
const texts = require('../../assets/json/name-rater');
|
const texts = require('../../assets/json/name-rater');
|
||||||
const { NAME_RATER_EMOJI_ID } = process.env;
|
const { NAME_RATER_EMOJI_ID } = process.env;
|
||||||
@@ -22,7 +23,7 @@ module.exports = class NameRaterCommand extends Command {
|
|||||||
{
|
{
|
||||||
key: 'name',
|
key: 'name',
|
||||||
prompt: 'What name do you want to determine the quality of?',
|
prompt: 'What name do you want to determine the quality of?',
|
||||||
type: 'string',
|
type: 'user|string',
|
||||||
max: 20,
|
max: 20,
|
||||||
default: msg => msg.author.username
|
default: msg => msg.author.username
|
||||||
}
|
}
|
||||||
@@ -31,6 +32,7 @@ module.exports = class NameRaterCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
run(msg, { name }) {
|
run(msg, { name }) {
|
||||||
|
if (name instanceof User) name = name.username;
|
||||||
if (name.toLowerCase() === 'xiao') {
|
if (name.toLowerCase() === 'xiao') {
|
||||||
return msg.reply(`<:nameRater:${NAME_RATER_EMOJI_ID}> Yes, ${name}! What a perfect name! I'm speechless!`);
|
return msg.reply(`<:nameRater:${NAME_RATER_EMOJI_ID}> Yes, ${name}! What a perfect name! I'm speechless!`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user