Skip to content

Instantly share code, notes, and snippets.

@dmillerw
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmillerw/9a1a36fff7a664d6677e to your computer and use it in GitHub Desktop.
Save dmillerw/9a1a36fff7a664d6677e to your computer and use it in GitHub Desktop.
-- notify background script
function get_message(user)
local message = storage.getf(user.nickname)
if message ~= nil then
storage.deletef(user.nickname)
return mesage
end
end
function onMessage(channel, user, message)
local msg = get_message(user)
if msg ~= nil then
channel.send("Hey " .. user.nickname .. "! " .. msg)
end
end
register_callback(CALLBACK_CHANNEL_MESSAGE, onMessage)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment