diff options
| author | ilotterytea <iltsu@alright.party> | 2025-07-23 18:39:12 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-07-23 18:39:12 +0500 |
| commit | 157a102b10aa481c1423a91360e8b5d90015b512 (patch) | |
| tree | 37e75da94a1e57867e117cc8902f159ed514ce38 /luamods/notify.lua | |
| parent | d9713c9184741a00c9d15f3ae50c96a5695afd92 (diff) | |
fix: !event and !notify couldnt parse http links
Diffstat (limited to 'luamods/notify.lua')
| -rw-r--r-- | luamods/notify.lua | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/luamods/notify.lua b/luamods/notify.lua index 26540e7..cf34619 100644 --- a/luamods/notify.lua +++ b/luamods/notify.lua @@ -1,15 +1,24 @@ local function parse_target(value) local parts = str_split(value, ':') - if #parts ~= 2 then + if #parts < 2 then return nil end + local type = parts[#parts] + local target = "" + for i = 1, #parts - 1, 1 do + target = target .. parts[i] + if i + 1 < #parts then + target = target .. ":" + end + end + local data = { - target = parts[1], - type = str_to_event_type(parts[2]) + target = target, + type = str_to_event_type(type) } - if event_type_to_str(data.type) ~= parts[2] then + if event_type_to_str(data.type) ~= type then data.type = nil end |
