Implement adding notes

This commit is contained in:
2025-01-15 11:55:02 +01:00
parent ec2f146095
commit 0bed5ecf41

View File

@@ -170,9 +170,13 @@ function shared.Noter.Init()
shared.dumpTable(args) shared.dumpTable(args)
local note = { local note = {
source = sender, source = sender,
date = date(), date = date("%Y-%m-%dT%H:%M:%S"),
note = args[3] note = args[3]
} }
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] Adding note for: %s", ModuleName, name))
shared.dumpTable(note)
end
table.insert(Heimdall_Data.config.notes[name], note) table.insert(Heimdall_Data.config.notes[name], note)
end end
@@ -239,10 +243,10 @@ function shared.Noter.Init()
end end
if note == "delete" then if note == "delete" then
DeleteNotes(name, args) DeleteNotes(name, args)
elseif string.find(note, "%D+") then
AddNote(name, sender, args)
elseif string.find(note, "[%d%.]*") then elseif string.find(note, "[%d%.]*") then
PrintNotes(name, args) PrintNotes(name, args)
else
AddNote(name, sender, args)
end end
end end
end) end)