try to fix pattern

This commit is contained in:
AFCMS 2021-04-12 15:48:13 +02:00
parent 0c32c94f73
commit b891a13787
2 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ mcl_commands.types = {
return S("Word is invalid!")
end
end},
quotestring = {'["]+(.+)["]+',
quotestring = {'"+(.-)"+',
function(res, pointer)
if res[pointer] == tostring(res[pointer]) then
return nil, string.sub(tostring(res[pointer]), 2, #res[pointer]-1), pointer+1

View File

@ -14,7 +14,7 @@ end
--TODO: toggle it with setting/mod
mcl_commands.register_command("bossbar", {
func = function(cmd)
cmd:sub("add :id: :string:word", {
cmd:sub("add :id: :string:quotestring", {
func = function(name, id, string)
mcl_commands.bossbar.registered_dynamic[id] = {text=string, color="white", percentage=100, players=nil} --set percentage to 0
return true, "Super"