rockneurotiko/ex_gram

Issue in `send_document` options

Closed this issue · 1 comments

Why do we need to add 'file content' ourselves in this file?

ExGram.send_document(chat_id, {:file_content, "FILE CONTENT", "filename.txt"}) # By content

I don't understand this function.

That is the way to send any content as any document, basically you are saying "send this file, this is the content, and this is the file name".

If you want to send the file directly from an existing file, you can do it with {:file, "/full/file/path"}

Eg:

ExGram.send_document(chat_id, {:file, "/home/rock/filename.txt"})