-
Notifications
You must be signed in to change notification settings - Fork 470
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
BotAPI7.2 #706
BotAPI7.2 #706
Conversation
bot.go
Outdated
@@ -1271,6 +1271,27 @@ func (b *Bot) botInfo(language, key string) (*BotInfo, error) { | |||
return resp.Result, nil | |||
} | |||
|
|||
// GetBusinessConnection use this method to get information about the connection of the bot with a business account. | |||
// Returns a BusinessConnection object on success. | |||
func (b *Bot) GetBusinessConnection(businessConnectionID string) (*BusinessConnection, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (b *Bot) BusinessConnection(connectionID string) (*BusinessConnection, error) {
params := map[string]string{
"business_connection_id": connectionID,
}
data, err := b.Raw("getBusinessConnection", params)
if err != nil {
return nil, err
}
var resp struct {
Result *BusinessConnection
}
if err := json.Unmarshal(data, &resp); err != nil {
return nil, wrapError(err)
}
return resp.Result, nil
}
message.go
Outdated
|
||
// (Optional) The bot that actually sent the message on behalf of the business account. | ||
// Available only for outgoing messages sent on behalf of the connected business account. | ||
SenderBusinessBot *User `json:"sender_business_bot"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BusinessBot *User `json:"sender_business_bot"`
sticker.go
Outdated
@@ -304,3 +303,24 @@ func (b *Bot) SetCustomEmojiStickerSetThumb(name, id string) error { | |||
_, err := b.Raw("setCustomEmojiStickerSetThumbnail", params) | |||
return err | |||
} | |||
|
|||
// ReplaceStickerInSet returns True on success, if existing sticker was replaced with a new one | |||
func (b *Bot) ReplaceStickerInSet(of Recipient, name, old_sticker string, sticker InputSticker) (bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (b *Bot) ReplaceStickerInSet(of Recipient, name, oldSticker string, sticker InputSticker) (bool, error) {
files := make(map[string]File)
repr := sticker.File.process("0", files)
if repr == "" {
return false, errors.New("telebot: sticker does not exist")
}
sticker.Sticker = repr
data, err := json.Marshal(sticker)
if err != nil {
...
}
params := map[string]string{
"user_id": of.Recipient(),
"name": name,
"old_stikcer": oldSticker,
"sticker": string(data),
}
_, err := b.sendFiles("replaceStickerInSet", files, params)
return true, err
}
sticker.go
Outdated
params := map[string]string{ | ||
"user_id": of.Recipient(), | ||
"name": name, | ||
"old_stikcer": oldSticker, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"old_sticker": oldSticker,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, already fixed.
* Integration with Business Accounts * Working on Behalf of Business Accounts * Information about Business Accounts * Mixed-Format Sticker Packs * Request Chat Improvements * Other Changes * business: satisfy change request
No description provided.