From 622415d1382513e2078c1e34e8246a017ca13cd8 Mon Sep 17 00:00:00 2001 From: ahmdrz Date: Sat, 15 Oct 2016 10:52:58 +0330 Subject: [PATCH] LeaveChat boolean result removed --- bot.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bot.go b/bot.go index 93a2d98..c5f49b0 100644 --- a/bot.go +++ b/bot.go @@ -652,13 +652,13 @@ func (b *Bot) GetFile(fileID string) (File, error) { } // LeaveChat , Use this method for your bot to leave a group, supergroup or channel. Returns True on success. -func (b *Bot) LeaveChat(recipient Recipient) (bool, error) { +func (b *Bot) LeaveChat(recipient Recipient) error { params := map[string]string{ "chat_id": recipient.Destination(), } responseJSON, err := sendCommand("leaveChat", b.Token, params) if err != nil { - return false, err + return err } var responseRecieved struct { @@ -668,14 +668,14 @@ func (b *Bot) LeaveChat(recipient Recipient) (bool, error) { err = json.Unmarshal(responseJSON, &responseRecieved) if err != nil { - return false, err + return err } if !responseRecieved.Ok { - return false, fmt.Errorf("telebot: leaveChat failure %s", responseRecieved.Result) + return fmt.Errorf("telebot: leaveChat failure %s", responseRecieved.Result) } - return responseRecieved.Result, nil + return nil } // GetChat get up to date information