/
sticker.go
90 lines (76 loc) · 2.09 KB
/
sticker.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package arguments
type SendStickerArgs struct {
_CommonSendArgs
}
func (a *SendStickerArgs) StickerId(stickerId string) {
a.getForm().WithString("sticker", stickerId)
}
func (a *SendStickerArgs) StickerFile(file InputFile) {
a.getForm().WithFile("sticker", file)
}
type GetStickerSetArgs struct {
_BasicArgs
}
func (a *GetStickerSetArgs) Name(name string) {
a.getForm().WithString("name", name)
}
type UploadStickerFileArgs struct {
_BasicArgs
}
func (a *UploadStickerFileArgs) UserId(userId int) {
a.getForm().WithInt("user_id", userId)
}
func (a *UploadStickerFileArgs) StickerFile(file InputFile) {
a.getForm().WithFile("png_sticker", file)
}
type AddStickerToSetArgs struct {
_BasicArgs
}
func (a *AddStickerToSetArgs) UserId(userId int) {
a.getForm().WithInt("user_id", userId)
}
func (a *AddStickerToSetArgs) Name(name string) {
a.getForm().WithString("name", name)
}
func (a *AddStickerToSetArgs) StickerId(fileId string) {
a.getForm().WithString("png_sticker", fileId)
}
func (a *AddStickerToSetArgs) StickerFile(file InputFile) {
a.getForm().WithFile("png_sticker", file)
}
func (a *AddStickerToSetArgs) Emojis(emojis string) {
a.getForm().WithString("emojis", emojis)
}
func (a *AddStickerToSetArgs) MaskPosition(point string, x, y, scale float64) {
mask := map[string]interface{}{
"point": point,
"x_shift": x,
"y_shift": y,
"scale": scale,
}
a.getForm().WithJson("mask_position", mask)
}
type CreateNewStickerSetArgs struct {
AddStickerToSetArgs
}
func (a *CreateNewStickerSetArgs) Title(title string) {
a.getForm().WithString("title", title)
}
func (a *CreateNewStickerSetArgs) ContainsMasks() {
a.getForm().WithBool("contains_masks", true)
}
type SetStickerPositionInSetArgs struct {
_BasicArgs
}
func (a *SetStickerPositionInSetArgs) StickerId(fileId string) {
a.getForm().WithString("sticker", fileId)
}
func (a *SetStickerPositionInSetArgs) Position(position int) {
a.getForm().WithInt("position", position)
}
type DeleteStickerFromSetArgs struct {
_BasicArgs
}
func (a *DeleteStickerFromSetArgs) StickerId(fileId string) {
a.getForm().WithString("sticker", fileId)
}