|
|
|
@ -287,18 +287,20 @@ def send_message(chatid, message_text, imageurl = nil)
|
|
|
|
|
if imageurl != nil
|
|
|
|
|
#Send message with text as html link to image
|
|
|
|
|
message = Telegram::Bot::Client.run(@token) {|bot| message = bot.api.send_message(chat_id: chatid, text: "#{message_text}<a href=\"#{imageurl}\">.</a>", parse_mode: "HTML") }
|
|
|
|
|
puts timestamp + ": Sent: #{message_text.inspect}\n\n"
|
|
|
|
|
STDOUT.flush
|
|
|
|
|
#puts timestamp + ": Sent: #{message_text.inspect}\n\n"
|
|
|
|
|
return message
|
|
|
|
|
else
|
|
|
|
|
#Send a plain-text message
|
|
|
|
|
message = Telegram::Bot::Client.run(@token) {|bot| bot.api.send_message(chat_id: chatid, text: message_text) }
|
|
|
|
|
puts timestamp + ": Sent: #{message_text.inspect}\n\n"
|
|
|
|
|
STDOUT.flush
|
|
|
|
|
#puts message
|
|
|
|
|
#message = message["results"]
|
|
|
|
|
#puts message
|
|
|
|
|
return message
|
|
|
|
|
end
|
|
|
|
|
STDOUT.flush
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def send_message_markdown(chatid, message_text)
|
|
|
|
|