diff --git a/bot.go b/bot.go index 165d3b6..ee1ddd0 100644 --- a/bot.go +++ b/bot.go @@ -934,3 +934,15 @@ func (bot *BotAPI) SetChatPhoto(config SetChatPhotoConfig) (APIResponse, error) return bot.UploadFile(config.method(), params, config.name(), file) } + +// DeleteChatPhoto delete photo of chat. +func (bot *BotAPI) DeleteChatPhoto(config DeleteChatPhotoConfig) (APIResponse, error) { + v, err := config.values() + if err != nil { + return APIResponse{}, err + } + + bot.debugLog(config.method(), v, nil) + + return bot.MakeRequest(config.method(), v) +} diff --git a/configs.go b/configs.go index 1bbaff4..574b3dd 100644 --- a/configs.go +++ b/configs.go @@ -1126,3 +1126,20 @@ func (config SetChatPhotoConfig) name() string { func (config SetChatPhotoConfig) method() string { return "setChatPhoto" } + +// DeleteChatPhotoConfig contains information for delete chat photo. +type DeleteChatPhotoConfig struct { + ChatID int64 +} + +func (config DeleteChatPhotoConfig) method() string { + return "deleteChatPhoto" +} + +func (config DeleteChatPhotoConfig) values() (url.Values, error) { + v := url.Values{} + + v.Add("chat_id", strconv.FormatInt(config.ChatID, 10)) + + return v, nil +}