markdown support in messages

other changes & improvements
This commit is contained in:
topkecleon
2015-12-05 09:30:52 -05:00
parent c5c3660de4
commit 80f363de44
8 changed files with 32 additions and 5 deletions

View File

@@ -13,6 +13,8 @@ local action = function(msg)
-- This is awkward, but if you have a better way, please share.
if msg.text_lower:match('^' .. bot.first_name .. ',') then
elseif msg.text_lower:match('^@' .. bot.username .. ',') then
elseif msg.text:match('^/') then
return true
-- Uncomment the following line for Al Gore-like reply chatter.
-- elseif msg.reply_to_message and msg.reply_to_message.from.id == bot.id then
elseif msg.from.id == msg.chat.id then

View File

@@ -1,7 +1,7 @@
-- Requires that the "fortune" program is installed on your computer.
local s = io.popen('fortune'):read('*all')
if s:match('fortune: command not found') then
local s = io.popen('fortune'):read('*all')
if s:match('fortune: command not found') then
print('fortune is not installed on this computer.')
print('fortune.lua will not be enabled.')
return

View File

@@ -90,7 +90,7 @@ local action = function(msg)
end
message = message .. title .. ' - ' .. artist
sendReply(msg, message)
sendMessage(msg.chat.id, message)
end

14
plugins/ping.lua Normal file
View File

@@ -0,0 +1,14 @@
-- Actually the simplest plugin ever!
local triggers = {
'^/ping[@'..bot.username..']*'
}
local action = function(msg)
sendMessage(msg.chat.id, 'Pong!')
end
return {
action = action,
triggers = triggers
}