updated readme, changed some things
This commit is contained in:
parent
4bd0a72b5a
commit
c5c3660de4
@ -1,7 +1,7 @@
|
|||||||
#otouto
|
#otouto
|
||||||
The plugin-wielding, multipurpose Telegram bot.
|
The plugin-wielding, multipurpose Telegram bot.
|
||||||
|
|
||||||
The public bot runs on [@mokubot](https://telegram.me/otouto).
|
The public bot runs on [@mokubot](https://telegram.me/mokubot).
|
||||||
|
|
||||||
otouto is licensed under the GNU General Public License. A copy of the license has been included in [LICENSE](https://github.com/topkecleon/otouto/blob/master/LICENSE).
|
otouto is licensed under the GNU General Public License. A copy of the license has been included in [LICENSE](https://github.com/topkecleon/otouto/blob/master/LICENSE).
|
||||||
|
|
||||||
|
2
bot.lua
2
bot.lua
@ -37,8 +37,8 @@ end
|
|||||||
|
|
||||||
on_msg_receive = function(msg) -- The fn run whenever a message is received.
|
on_msg_receive = function(msg) -- The fn run whenever a message is received.
|
||||||
|
|
||||||
if not msg.text then msg.text = msg.caption or '' end -- So about.lua works.
|
|
||||||
if msg.date < os.time() - 5 then return end -- Do not process old messages.
|
if msg.date < os.time() - 5 then return end -- Do not process old messages.
|
||||||
|
if not msg.text then msg.text = msg.caption or '' end
|
||||||
|
|
||||||
msg.chat.id_str = tostring(msg.chat.id)
|
msg.chat.id_str = tostring(msg.chat.id)
|
||||||
msg.from.id_str = tostring(msg.from.id)
|
msg.from.id_str = tostring(msg.from.id)
|
||||||
|
@ -15,7 +15,7 @@ local action = function(msg)
|
|||||||
sendMessage(msg.chat.id, message)
|
sendMessage(msg.chat.id, message)
|
||||||
return
|
return
|
||||||
elseif string.match(msg.text_lower, '^/about[@'..bot.username..']*') then
|
elseif string.match(msg.text_lower, '^/about[@'..bot.username..']*') then
|
||||||
sendReply(msg, message)
|
sendMessage(msg.chat.id, message)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ local action = function(msg)
|
|||||||
local input = msg.text:input()
|
local input = msg.text:input()
|
||||||
|
|
||||||
if input then
|
if input then
|
||||||
sendReply(msg, latcyr(input))
|
sendMessage(msg.chat.id, latcyr(input))
|
||||||
else
|
else
|
||||||
sendReply(msg, doc)
|
sendReply(msg, doc)
|
||||||
end
|
end
|
||||||
|
@ -47,7 +47,7 @@ local action = function(msg)
|
|||||||
|
|
||||||
local message
|
local message
|
||||||
|
|
||||||
if msg.text:match('y/n%p?$') then
|
if msg.text_lower:match('y/n%p?$') then
|
||||||
message = yesno_answers[math.random(#yesno_answers)]
|
message = yesno_answers[math.random(#yesno_answers)]
|
||||||
else
|
else
|
||||||
message = ball_answers[math.random(#ball_answers)]
|
message = ball_answers[math.random(#ball_answers)]
|
||||||
|
Reference in New Issue
Block a user