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

api: implement 6.6, 6.7 features #655

Merged
merged 7 commits into from
Feb 27, 2024
Merged

Conversation

Nash-Well
Copy link
Contributor

No description provided.

@Nash-Well Nash-Well changed the title Feature/api6.6 api: implement 6.7 features Feb 23, 2024
@demget demget changed the title api: implement 6.7 features api: implement 6.6, 6.7 features Feb 25, 2024
@demget demget added this to the v3.3 milestone Feb 25, 2024
@demget
Copy link
Collaborator

demget commented Feb 26, 2024

Previous StickerSet:

type StickerSet struct {
	Type          StickerSetType `json:"sticker_type"`
	Name          string         `json:"name"`
	Title         string         `json:"title"`
	Animated      bool           `json:"is_animated"`
	Video         bool           `json:"is_video"`
	Stickers      []Sticker      `json:"stickers"`
	Thumbnail     *Photo         `json:"thumb"`
	PNG           *File          `json:"png_sticker"`
	TGS           *File          `json:"tgs_sticker"`
	WebM          *File          `json:"webm_sticker"`
	Emojis        string         `json:"emojis"`
	ContainsMasks bool           `json:"contains_masks"` // FIXME: can be removed
	MaskPosition  *MaskPosition  `json:"mask_position"`
}

New StickerSet:

type StickerSet struct {
	Type          StickerSetType `json:"sticker_type"`
	Format        StickerSetFormat `json:"sticker_format"`
	Name          string         `json:"name"`
	Title         string         `json:"title"`
	Animated      bool           `json:"is_animated"`
	Video         bool           `json:"is_video"`
	Stickers      []Sticker      `json:"stickers"`
	Thumbnail     *Photo         `json:"thumb"`
	Emojis        string         `json:"emojis"`
	ContainsMasks bool           `json:"contains_masks"` // FIXME: can be removed
	MaskPosition  *MaskPosition  `json:"mask_position"`
	Repaint       bool           `json:"needs_repainting"`
	Stickers      []Sticker      `json:"stickers"`
}

bot.go Outdated Show resolved Hide resolved
bot.go Outdated Show resolved Hide resolved
inline.go Outdated Show resolved Hide resolved
media.go Outdated Show resolved Hide resolved
media.go Outdated Show resolved Hide resolved
media.go Outdated Show resolved Hide resolved
stickers.go Outdated
@@ -72,6 +73,31 @@ func (b *Bot) UploadSticker(to Recipient, png *File) (*File, error) {
return &resp.Result, nil
}

// UploadStickerFile uploads a PNG file with a sticker for later use.
func (b *Bot) UploadStickerFile(to Recipient, s Sticker) (*File, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename it to the UploadSticker, remove the original one.

stickers.go Outdated
@@ -145,6 +172,33 @@ func (b *Bot) AddSticker(to Recipient, s StickerSet) error {
return err
}

// AddStickerToSet adds a new sticker to the existing sticker set.
func (b *Bot) AddStickerToSet(to Recipient, name string, s Sticker) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove AddSticker

stickers.go Outdated Show resolved Hide resolved
type StickerSetFormat = string

const (
StickerStatic = "static"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth adding a context to these constants:

	StickerStatic   StickerSetFormat = "static"
	StickerAnimated StickerSetFormat = "animated"
	StickerVideo    StickerSetFormat = "video"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do same for the StickerSetType above.

@demget demget changed the base branch from v3 to v3.3 February 27, 2024 12:11
@demget demget merged commit 32b47a4 into tucnak:v3.3 Feb 27, 2024
1 check passed
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