markdown support in messages
other changes & improvements
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
14
plugins/ping.lua
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user