lib/te_bot/wire.rb in te_bot-0.3.0 vs lib/te_bot/wire.rb in te_bot-0.4.0

- old
+ new

@@ -41,10 +41,10 @@ message_format, message = payload.first handler = self.class.senders[message_format] raise ArgumentError, "Message type invalid. sender :#{message_format} not defined" if handler.nil? - return handler.call(self, chat_id, message) if handler.respond_to?(:call) + return instance_exec(chat_id, message, &handler) if handler.respond_to?(:call) public_send(handler, chat_id, message) end end end