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:
parent
1a52caab6b
commit
6ab4bd64a8
12 changed files with 354 additions and 34 deletions
13
src/utils.js
13
src/utils.js
|
@ -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 || {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue