From 979e896d6b27d1f8cf2ace7ac5fe9faafe485cae Mon Sep 17 00:00:00 2001 From: Robert Barrow Date: Tue, 1 Oct 2019 18:14:15 +0100 Subject: [PATCH] leave send_message if there are any empty data fields --- lib/builder.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/builder.rb b/lib/builder.rb index aee20c46..e7a25a80 100644 --- a/lib/builder.rb +++ b/lib/builder.rb @@ -423,6 +423,16 @@ class CustomWizard::Builder def send_message(user, action, data) + empty_data = false + + data.each do |k, v| + if v.empty? + empty_data = true + end + end + # leave if there are any empty fields + return if empty_data + unless action['custom_title_enabled'] title = data[action['title']] else