From 5dd6946f99939ee7880f1cd38d268d7e8f0bb9f9 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Tue, 19 Mar 2024 22:34:25 -0400 Subject: [PATCH] emoji-regex --- commands/games-mp/connect-four.js | 4 ++-- framework/types/default-emoji.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/games-mp/connect-four.js b/commands/games-mp/connect-four.js index f89cb703..681ddcec 100644 --- a/commands/games-mp/connect-four.js +++ b/commands/games-mp/connect-four.js @@ -1,7 +1,7 @@ const Command = require('../../framework/Command'); const { Connect4AI } = require('connect4-ai'); const { stripIndents } = require('common-tags'); -const emojiRegex = require('emoji-regex/RGI_Emoji.js'); +const emojiRegex = require('emoji-regex'); const { verify, list } = require('../../util/Util'); const { LOADING_EMOJI_ID } = process.env; const blankEmoji = '⚪'; @@ -36,7 +36,7 @@ module.exports = class ConnectFourCommand extends Command { prompt: `What color do you want to be? Either an emoji or one of ${list(Object.keys(colors), 'or')}.`, type: 'default-emoji|custom-emoji|string', validate: (color, msg) => { - const hasEmoji = new RegExp(`^(?:${emojiRegex().source})$`).test(color); + const hasEmoji = new RegExp(`^(?:${emojiRegex().toString()})$`).test(color); const hasCustom = color.match(customEmojiRegex); if (hasCustom && !msg.guild) return 'You can only use custom emoji in a server.'; if (hasCustom && msg.guild && !msg.guild.emojis.cache.has(hasCustom[2])) { diff --git a/framework/types/default-emoji.js b/framework/types/default-emoji.js index 183cabca..8a04ce55 100644 --- a/framework/types/default-emoji.js +++ b/framework/types/default-emoji.js @@ -1,10 +1,10 @@ const ArgumentType = require('../ArgumentType'); -const emojiRegex = require('emoji-regex/RGI_Emoji.js'); +const emojiRegex = require('emoji-regex'); module.exports = class DefaultEmojiArgumentType extends ArgumentType { constructor(client) { super(client, 'default-emoji'); - this.regex = new RegExp(`^(?:${emojiRegex().source})$`); + this.regex = new RegExp(`^(?:${emojiRegex().toString()})$`); } validate(value) {