From 157a102b10aa481c1423a91360e8b5d90015b512 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 23 Jul 2025 18:39:12 +0500 Subject: fix: !event and !notify couldnt parse http links --- luamods/notify.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'luamods/notify.lua') 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 -- cgit v1.2.3