Skip to content

Commit

Permalink
Can use Redis!
Browse files Browse the repository at this point in the history
  • Loading branch information
yagop committed Apr 29, 2015
1 parent f6e4ba4 commit 0f72991
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bot/bot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ function on_msg_receive (msg)
-- vardump(msg)
if msg_valid(msg) then
msg = pre_process_msg(msg)
match_plugins(msg)
mark_read(receiver, ok_cb, false)
if msg then
match_plugins(msg)
mark_read(receiver, ok_cb, false)
end
end
end

Expand Down Expand Up @@ -73,7 +75,7 @@ end
-- Apply plugin.pre_process function
function pre_process_msg(msg)
for name,plugin in pairs(plugins) do
if plugin.pre_process then
if plugin.pre_process and msg then
msg = plugin.pre_process(msg)
end
end
Expand Down
1 change: 1 addition & 0 deletions bot/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ URL = require "socket.url"
json = (loadfile "./libs/JSON.lua")()
serpent = (loadfile "./libs/serpent.lua")()
mimetype = (loadfile "./libs/mimetype.lua")()
redis = (loadfile "./libs/redis.lua")()

http.TIMEOUT = 10

Expand Down

0 comments on commit 0f72991

Please sign in to comment.