Last active
August 29, 2015 14:12
-
-
Save dmillerw/9a1a36fff7a664d6677e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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