Version 0.8.3

This commit is contained in:
yago 2015-01-12 20:40:39 +01:00
commit 5eb58870d2

View File

@ -5,7 +5,7 @@ json = (loadfile "./libs/JSON.lua")()
serpent = (loadfile "./libs/serpent.lua")() serpent = (loadfile "./libs/serpent.lua")()
require("./bot/utils") require("./bot/utils")
VERSION = '0.8.2' VERSION = '0.8.3'
function on_msg_receive (msg) function on_msg_receive (msg)
vardump(msg) vardump(msg)
@ -15,8 +15,6 @@ function on_msg_receive (msg)
end end
do_action(msg) do_action(msg)
mark_read(get_receiver(msg), ok_cb, false)
end end
function ok_cb(extra, success, result) function ok_cb(extra, success, result)
@ -25,7 +23,7 @@ end
function on_binlog_replay_end () function on_binlog_replay_end ()
started = 1 started = 1
-- Uncomment the line to enable cron plugins. -- Uncomment the line to enable cron plugins.
-- postpone (cron_plugins, false, 5.0) postpone (cron_plugins, false, 60*5.0)
-- See plugins/ping.lua as an example for cron -- See plugins/ping.lua as an example for cron
_config = load_config() _config = load_config()
@ -58,7 +56,6 @@ function do_lex(msg, text)
end end
end end
end end
-- print("Text mutated to " .. text)
return text return text
end end
@ -71,7 +68,6 @@ function do_action(msg)
-- we can match on it. The plugin is resposible for handling -- we can match on it. The plugin is resposible for handling
text = '['..msg.media.type..']' text = '['..msg.media.type..']'
end end
-- print("Received msg", text)
msg.text = do_lex(msg, text) msg.text = do_lex(msg, text)
@ -81,6 +77,7 @@ function do_action(msg)
-- print("Trying", text, "against", pattern) -- print("Trying", text, "against", pattern)
matches = { string.match(text, pattern) } matches = { string.match(text, pattern) }
if matches[1] then if matches[1] then
mark_read(get_receiver(msg), ok_cb, false)
print(" matches", pattern) print(" matches", pattern)
if desc.run ~= nil then if desc.run ~= nil then
-- If plugin is for privileged user -- If plugin is for privileged user
@ -145,15 +142,16 @@ function create_config( )
-- A simple config with basic plugins and ourserves as priviled user -- A simple config with basic plugins and ourserves as priviled user
config = { config = {
enabled_plugins = { enabled_plugins = {
"9gag", "9gag",
"echo", "echo",
"get", "get",
"set", "help"
"images", "images",
"img_google", "img_google",
"location", "location",
"media", "media",
"plugins", "plugins",
"set",
"stats", "stats",
"time", "time",
"version", "version",
@ -208,4 +206,4 @@ end
-- Start and load values -- Start and load values
our_id = 0 our_id = 0
now = os.time() now = os.time()