diff --git a/src/games/8ball.js b/src/games/8ball.js index 53204b1..5ab64f0 100644 --- a/src/games/8ball.js +++ b/src/games/8ball.js @@ -56,7 +56,7 @@ function purgeQuestions() { async function onCommand(args, context) { const question = args.join(' '); - if (!/\w+\s+\w+\?/.test(question)) { + if (!/[\w\p{P}]+\s+[\w\p{P}]+\?/.test(question)) { context.sendMessage('Please ask me a question, any question...', context.room.id); return; } @@ -93,7 +93,7 @@ async function onCommand(args, context) { } function onMessage(message, context) { - const regex = new RegExp(`^${config.usernamePrefix}${config.user.username}:?\\s+\\w+\\s+\\w+.*\\?`, 'i'); + const regex = new RegExp(`^${config.usernamePrefix}${config.user.username}:?\\s+[\\w\\p{P}]+\\s+[\\w, \\p{P}]+.*\\?`, 'i'); if (regex.test(message.body)) { onCommand([message.body.replaceAll(`${config.usernamePrefix}${config.user.username}:?`, '').trim()], context, false);