mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-24 23:57:38 +01:00
Fix missing MultipartRequest for create_new_sticker_set
This commit is contained in:
parent
cba7fbe743
commit
344ace253d
2 changed files with 16 additions and 2 deletions
|
@ -1102,7 +1102,7 @@ impl Requester for Bot {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateNewStickerSet = JsonRequest<payloads::CreateNewStickerSet>;
|
type CreateNewStickerSet = MultipartRequest<payloads::CreateNewStickerSet>;
|
||||||
|
|
||||||
fn create_new_sticker_set<N, T, S>(
|
fn create_new_sticker_set<N, T, S>(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
payloads,
|
payloads,
|
||||||
requests::Payload,
|
requests::Payload,
|
||||||
types::{InputFile, InputFileLike, InputMedia},
|
types::{InputFile, InputFileLike, InputMedia, InputSticker},
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Payloads that need to be sent as `multipart/form-data` because they contain
|
/// Payloads that need to be sent as `multipart/form-data` because they contain
|
||||||
|
@ -41,3 +41,17 @@ impl MultipartPayload for payloads::EditMessageMediaInline {
|
||||||
self.media.files_mut().for_each(|f| f.move_into(into))
|
self.media.files_mut().for_each(|f| f.move_into(into))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl MultipartPayload for payloads::CreateNewStickerSet {
|
||||||
|
fn copy_files(&self, into: &mut dyn FnMut(InputFile)) {
|
||||||
|
self.stickers
|
||||||
|
.iter()
|
||||||
|
.for_each(|InputSticker { sticker: f, .. }: &InputSticker| f.copy_into(into))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn move_files(&mut self, into: &mut dyn FnMut(InputFile)) {
|
||||||
|
self.stickers
|
||||||
|
.iter_mut()
|
||||||
|
.for_each(|InputSticker { sticker: f, .. }: &mut InputSticker| f.move_into(into))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue