add setChatPhoto method

This commit is contained in:
Oleksandr Savchuk 2018-03-05 17:04:37 +02:00
parent 6e69f99d11
commit 57be988011
3 changed files with 58 additions and 0 deletions

12
bot.go
View file

@ -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)
}