feat(notify): add libs/notify
This commit is contained in:
parent
154f96b676
commit
b5aeb3532e
@ -33,6 +33,7 @@ local LIST_LIBS_FILES = {
|
||||
'libs/turtle-utils.lua',
|
||||
'libs/robot.lua',
|
||||
'libs/inferium.lua',
|
||||
'libs/notify.lua',
|
||||
'libs/ui/CountersSelector.lua'
|
||||
}
|
||||
|
||||
|
||||
21
libs/notify.lua
Normal file
21
libs/notify.lua
Normal file
@ -0,0 +1,21 @@
|
||||
local net = require('libs/net')
|
||||
|
||||
local notify = {}
|
||||
|
||||
local DEFAULT_PREFIX = 'chatBox'
|
||||
|
||||
notify.NOTIFY_SERVER = 'notify.com'
|
||||
|
||||
notify.sendChatMessage = function(message, prefix)
|
||||
prefix = prefix or DEFAULT_PREFIX
|
||||
|
||||
return net.sendQuery(notify.NOTIFY_SERVER, {
|
||||
type = 'notify-chat',
|
||||
payload = {
|
||||
prefix = prefix,
|
||||
message = message
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
return notify
|
||||
Loading…
Reference in New Issue
Block a user