Skip to content

Ability to attach files formed from bytes#182

Open
akahan wants to merge 4 commits intoayrat555:masterfrom
akahan:send_buffer
Open

Ability to attach files formed from bytes#182
akahan wants to merge 4 commits intoayrat555:masterfrom
akahan:send_buffer

Conversation

@akahan
Copy link
Copy Markdown

@akahan akahan commented Jul 26, 2024

Example:

    let params = SendDocumentParams::builder()
        .chat_id(chat_id.to_string())
        .document(("Bytes".to_string(), bytes.to_vec()))
        .caption("Send bytes example")
        .build();

    frankenstein::AsyncApi::new(token).send_document(&params).await.unwrap();

@akahan akahan changed the title Ability to sendDocument formed from bytes Ability to attach files formed from bytes Jul 29, 2024
Comment thread src/api_params.rs
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)]
pub struct InputBuf {
pub file_name: String,
pub data: Vec<u8>,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of providing Vec. what do you think about using generic AsRef<[u8]>

in this case it will be more flexible.

Copy link
Copy Markdown
Author

@akahan akahan Aug 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I also support this idea. I'll work on it.

@ayrat555 ayrat555 requested a review from EdJoPaTo August 3, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants