rockneurotiko/ex_gram

Is there some way to send a photo without a path, with the photo content directly?

jhg opened this issue · 3 comments

jhg commented
Is there some way to send a photo without a path, with the photo content directly?

👋

It's not possible with the current release, but I created a branch with the feature. I tried myself, but I would appreciate you can try it before releasing it.

You just need to set the version in your mix.exs to:
{:ex_gram, "~> 0.21"}

And where you want to send the file contents, instead of {:file, "path"}, you use {:file_content, "CONTENTS", "filename.ext"}, ex:

ExGram.send_document(111111111, {:file_content, "abcde", "myfile.txt"}, bot: :bot)

I merged the branch, you can use the version "~> 0.21" in order to have the file_content feature

jhg commented

IMG_20201230_234457
Thanks @rockneurotiko 🤗 it works well! I'm sorry late to try it. I continue the bot today and now it can send the photo downloaded from this person does not exist directly without tmp file.