diff --git a/run.rb b/run.rb index bd831d5..d3f443c 100755 --- a/run.rb +++ b/run.rb @@ -230,8 +230,6 @@ def handle_message(message) else reply = "Mockery: My name is #{message.from.username}, I am a meatbag, and I think #{command} is a valid command." end - # Verbose output: - puts timestamp + ": Sending #{reply.inspect}\n\n" STDOUT.flush #puts "End of case" return reply @@ -244,10 +242,18 @@ Telegram::Bot::Client.run(token) do |bot| #puts "DEBUG: #{validation}" if validation reply = handle_message(message) - if reply == "dance" || reply == "flex" - bot.api.sendVideo(chat_id: message.chat.id, video: "https://img.skyfalltech.net/togra/#{reply}.gif") - elsif ! message.text.nil? - bot.api.send_message(chat_id: message.chat.id, text: "#{reply}") + print timestamp + ": Sending ............ " + if ! message.text.nil? + if reply == "dance" || reply == "flex" + bot.api.sendVideo(chat_id: message.chat.id, video: "https://img.skyfalltech.net/togra/#{reply}.gif") + else + bot.api.send_message(chat_id: message.chat.id, text: "#{reply}") + print "OK\n".green.bold + puts "Sent: #{reply.inspect}\n\n" + end + else + print 'FAIL'.red.bold + print " (Message is NULL)\n\n" end STDOUT.flush else