Fixed chat prompt regex breaking if no username prefix is configured.

This commit is contained in:
Niels Simenon
2023-04-09 00:20:29 +02:00
parent 834ccc3ea0
commit 8f37ee145e

View File

@@ -5,7 +5,7 @@ const bhttp = require('bhttp');
const style = require('../utils/style'); const style = require('../utils/style');
const promptRegex = new RegExp(`^${config.usernamePrefix}?${config.user.username}[:,\\s]`, 'ui'); const promptRegex = new RegExp(`^${config.usernamePrefix ? `${config.usernamePrefix}?` : ''}${config.user.username}[:,\\s]`, 'ui');
const history = new Map(); const history = new Map();
const settings = config.chat; const settings = config.chat;