From 60835022fb87184ce981385346ad7d862371b89a Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sat, 13 Jan 2018 23:11:45 -0800 Subject: [PATCH] Add cast to fix sending File URLs. --- src/telepathy/bot.cr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/telepathy/bot.cr b/src/telepathy/bot.cr index fad0088..ad530c7 100644 --- a/src/telepathy/bot.cr +++ b/src/telepathy/bot.cr @@ -79,8 +79,9 @@ module Telepathy when String formdata.field("photo", photo.as(String)) when File - formdata.file("photo", photo.as(IO), - HTTP::FormData::FileMetadata.new(filename: File.basename(photo.path))) + photo_file = photo.as(File) + formdata.file("photo", photo_file, + HTTP::FormData::FileMetadata.new(filename: File.basename(photo_file.path))) end end