add setChatPhoto method
This commit is contained in:
parent
6e69f99d11
commit
57be988011
3 changed files with 58 additions and 0 deletions
12
bot.go
12
bot.go
|
@ -922,3 +922,15 @@ func (bot *BotAPI) SetChatDescription(config SetChatDescriptionConfig) (APIRespo
|
|||
|
||||
return bot.MakeRequest(config.method(), v)
|
||||
}
|
||||
|
||||
// SetChatPhoto change photo of chat.
|
||||
func (bot *BotAPI) SetChatPhoto(config SetChatPhotoConfig) (APIResponse, error) {
|
||||
params, err := config.params()
|
||||
if err != nil {
|
||||
return APIResponse{}, err
|
||||
}
|
||||
|
||||
file := config.getFile()
|
||||
|
||||
return bot.UploadFile(config.method(), params, config.name(), file)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue