little changes

This commit is contained in:
yago 2015-02-15 12:00:33 +01:00
parent f595cb1c85
commit cc76046156

View File

@ -47,6 +47,7 @@ function msg_valid(msg)
end
function do_lex(msg, text)
-- Plugins which implements lex.
for name, desc in pairs(plugins) do
if (desc.lex ~= nil) then
result = desc.lex(msg, text)
@ -64,9 +65,9 @@ function do_action(msg)
local receiver = get_receiver(msg)
local text = msg.text
if msg.text == nil then
if text == nil then
-- Not a text message, make text the same as what tg shows so
-- we can match on it. The plugin is resposible for handling
-- we can match on it. Maybe a plugin activated my media type.
if msg.media ~= nil then
text = '['..msg.media.type..']'
end
@ -149,10 +150,13 @@ function create_config( )
config = {
enabled_plugins = {
"9gag",
"eur",
"echo",
"btc",
"get",
"giphy",
"google",
"gps",
"help",
"images",
"img_google",
@ -164,6 +168,7 @@ function create_config( )
"time",
"version",
"weather",
"xkcd",
"youtube" },
sudo_users = {our_id}
}