diff --git a/src/games/8ball.js b/src/games/8ball.js index 5ab64f0..241be5c 100644 --- a/src/games/8ball.js +++ b/src/games/8ball.js @@ -9,8 +9,10 @@ const style = require('../utils/style'); const contemplations = [ 'Hmmm...', + 'Let me see...', + 'Let me give that some thought', '🤔', - 'Let\'s see...', + '💭', ]; const answersByType = { @@ -56,7 +58,7 @@ function purgeQuestions() { async function onCommand(args, context) { const question = args.join(' '); - if (!/[\w\p{P}]+\s+[\w\p{P}]+\?/.test(question)) { + if (!/[\w\p{P}]+\s+[\w\p{P}]+\?/u.test(question)) { context.sendMessage('Please ask me a question, any question...', context.room.id); return; } @@ -93,7 +95,7 @@ async function onCommand(args, context) { } function onMessage(message, context) { - const regex = new RegExp(`^${config.usernamePrefix}${config.user.username}:?\\s+[\\w\\p{P}]+\\s+[\\w, \\p{P}]+.*\\?`, 'i'); + const regex = new RegExp(`^${config.usernamePrefix}${config.user.username}[\\s\\p{P}]*\\s+[\\w\\p{P}]+\\s+[\\w, \\p{P}]+.*\\?`, 'ui'); if (regex.test(message.body)) { onCommand([message.body.replaceAll(`${config.usernamePrefix}${config.user.username}:?`, '').trim()], context, false);