From 4848c9875bef4dfbe3a1b6d26f0004734cef5c8d Mon Sep 17 00:00:00 2001 From: topkecleon Date: Wed, 1 Jun 2016 21:01:45 -0400 Subject: [PATCH] add reply-to input support to shout.lua --- plugins/shout.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/shout.lua b/plugins/shout.lua index 602fecc..40581fc 100644 --- a/plugins/shout.lua +++ b/plugins/shout.lua @@ -5,7 +5,7 @@ local utilities = require('utilities') shout.command = 'shout ' shout.doc = [[``` /shout -Shouts something. +Shouts something. Input may be the replied-to message. ```]] function shout:init() @@ -15,10 +15,13 @@ end function shout:action(msg) local input = utilities.input(msg.text) - if not input then - utilities.send_message(self, msg.chat.id, shout.doc, true, msg.message_id, true) - return + if msg.reply_to_message and #msg.reply_to_message.text > 0 then + input = msg.reply_to_message.text + else + utilities.send_message(self, msg.chat.id, shout.doc, true, msg.message_id, true) + return + end end input = utilities.trim(input)