Fix sticker_type param serialization

This commit is contained in:
Maybe Waffle 2022-09-25 20:59:05 +04:00
parent 967da8fd9e
commit 7550af9a25
2 changed files with 4 additions and 1 deletions

View file

@ -222,7 +222,9 @@ fn params(params: impl Iterator<Item = impl Borrow<Param>>) -> String {
let field = &param.name;
let ty = &param.ty;
let flatten = match ty {
Type::RawTy(s) if s == "InputSticker" || s == "TargetMessage" => {
Type::RawTy(s)
if s == "InputSticker" || s == "TargetMessage" || s == "StickerType" =>
{
"\n #[serde(flatten)]"
}
_ => "",

View file

@ -26,6 +26,7 @@ impl_payload! {
}
optional {
/// Type of stickers in the set, pass “regular” or “mask”. Custom emoji sticker sets can't be created via the Bot API at the moment. By default, a regular sticker set is created.
#[serde(flatten)]
pub sticker_type: StickerType,
/// A JSON-serialized object for position where the mask should be placed on faces
pub mask_position: MaskPosition,