Remove new methods that returned APIResponse.
parent
6a6de7e674
commit
1aef8c8c45
42
bot.go
42
bot.go
|
@ -572,45 +572,3 @@ func (bot *BotAPI) GetStickerSet(config GetStickerSetConfig) (StickerSet, error)
|
||||||
|
|
||||||
return stickers, err
|
return stickers, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetChatTitle change title of chat.
|
|
||||||
func (bot *BotAPI) SetChatTitle(config SetChatTitleConfig) (APIResponse, error) {
|
|
||||||
v, err := config.values()
|
|
||||||
if err != nil {
|
|
||||||
return APIResponse{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return bot.MakeRequest(config.method(), v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetChatDescription change description of chat.
|
|
||||||
func (bot *BotAPI) SetChatDescription(config SetChatDescriptionConfig) (APIResponse, error) {
|
|
||||||
v, err := config.values()
|
|
||||||
if err != nil {
|
|
||||||
return APIResponse{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeleteChatPhoto delete photo of chat.
|
|
||||||
func (bot *BotAPI) DeleteChatPhoto(config DeleteChatPhotoConfig) (APIResponse, error) {
|
|
||||||
v, err := config.values()
|
|
||||||
if err != nil {
|
|
||||||
return APIResponse{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return bot.MakeRequest(config.method(), v)
|
|
||||||
}
|
|
||||||
|
|
35
helpers.go
35
helpers.go
|
@ -684,3 +684,38 @@ func NewSetChatPhotoShare(chatID int64, fileID string) SetChatPhotoConfig {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewChatTitle allows you to update the title of a chat.
|
||||||
|
func NewChatTitle(chatID int64, title string) SetChatTitleConfig {
|
||||||
|
return SetChatTitleConfig{
|
||||||
|
ChatID: chatID,
|
||||||
|
Title: title,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewChatDescription allows you to update the description of a chat.
|
||||||
|
func NewChatDescription(chatID int64, description string) SetChatDescriptionConfig {
|
||||||
|
return SetChatDescriptionConfig{
|
||||||
|
ChatID: chatID,
|
||||||
|
Description: description,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewChatPhoto allows you to update the photo for a chat.
|
||||||
|
func NewChatPhoto(chatID int64, photo interface{}) SetChatPhotoConfig {
|
||||||
|
return SetChatPhotoConfig{
|
||||||
|
BaseFile: BaseFile{
|
||||||
|
BaseChat: BaseChat{
|
||||||
|
ChatID: chatID,
|
||||||
|
},
|
||||||
|
File: photo,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewDeleteChatPhoto allows you to delete the photo for a chat.
|
||||||
|
func NewDeleteChatPhoto(chatID int64, photo interface{}) DeleteChatPhotoConfig {
|
||||||
|
return DeleteChatPhotoConfig{
|
||||||
|
ChatID: chatID,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue