1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 15:27:43 +00:00

3.5.325. Tab complete commands. CSS tweaks. Fix chat lines not updating.

This commit is contained in:
SirStendec 2016-10-12 16:42:43 -04:00
parent 1a52caab6b
commit 6ab4bd64a8
12 changed files with 354 additions and 34 deletions

View file

@ -554,6 +554,19 @@ module.exports = FFZ.utils = {
CMD_VAR_REGEX: CMD_VAR_REGEX,
extract_cmd_variables: function(command, args_only) {
var matches = [];
CMD_VAR_REGEX.lastIndex = 0;
command.replace(CMD_VAR_REGEX, function(match, variable) {
if ( args_only && ! /\d+(?:$\d*)?/.test(variable) )
return;
matches.push('{' + variable + '}');
});
return _.unique(matches);
},
replace_cmd_variables: function(command, user, room, message, args) {
user = user || {};
room = room || {};