Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to attach files formed from bytes #182

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

akahan
Copy link

@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
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Builder)]
pub struct InputBuf {
pub file_name: String,
pub data: Vec<u8>,
Copy link
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
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