Skip to content

Commit

Permalink
Added field mask_position to the addStickerToSet method #120
Browse files Browse the repository at this point in the history
  • Loading branch information
pengrad committed Dec 10, 2017
1 parent fb6c3c4 commit 2e57e92
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.iml
.gradle
build
out

.DS_Store
local.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.pengrad.telegrambot.request;

import com.pengrad.telegrambot.model.MaskPosition;
import com.pengrad.telegrambot.response.BaseResponse;

/**
Expand All @@ -14,4 +15,8 @@ public AddStickerToSet(Integer userId, String name, Object pngSticker, String em
add("name", name);
add("emojis", emojis);
}

public AddStickerToSet maskPosition(MaskPosition maskPosition) {
return add("mask_position", serialize(maskPosition));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,8 @@ public void createNewStickerSet() throws IOException {
@Test
public void addStickerToSet() {
BaseResponse response = bot.execute(
new AddStickerToSet(chatId, stickerSet, "BQADAgADuAAD7yupS4eB23UmZhGuAg", "\uD83D\uDE15"));
new AddStickerToSet(chatId, stickerSet, "BQADAgADuAAD7yupS4eB23UmZhGuAg", "\uD83D\uDE15")
.maskPosition(new MaskPosition("eyes", 0f, 0f, 1f)));
assertTrue(response.isOk());
}

Expand Down

0 comments on commit 2e57e92

Please sign in to comment.