mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 16:19:12 +02:00
Fix
This commit is contained in:
@@ -34,11 +34,11 @@ module.exports = class SmashBrosCommand extends Command {
|
|||||||
async run(msg, { query }) {
|
async run(msg, { query }) {
|
||||||
try {
|
try {
|
||||||
const fighters = await this.fetchFighters();
|
const fighters = await this.fetchFighters();
|
||||||
const found = fighters.find(fighter => {
|
const fighter = fighters.find(fighter => {
|
||||||
const search = query.toLowerCase().replaceAll(' ', '_').replace(/[^A-Z_]/i, '');
|
const search = query.toLowerCase().replaceAll(' ', '_').replace(/[^A-Z_]/i, '');
|
||||||
return search === fighter.slug;
|
return search === fighter.slug;
|
||||||
});
|
});
|
||||||
if (!found) return msg.say('Could not find any results.');
|
if (!fighter) return msg.say('Could not find any results.');
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setColor(fighter.color)
|
.setColor(fighter.color)
|
||||||
.setTitle(fighter.name)
|
.setTitle(fighter.name)
|
||||||
|
|||||||
Reference in New Issue
Block a user