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