Archived
1
This repository has been archived on 2022-11-04. You can view files and clone it, but cannot push or open issues or pull requests.
fwzookeeper/vendor/gitlab.com/toby3d/telegram/get_chat_members_count.go
2018-11-29 20:32:51 +04:00

27 lines
675 B
Go

package telegram
import json "github.com/pquerna/ffjson/ffjson"
// GetChatMembersCountParameters represents data for GetChatMembersCount method.
type GetChatMembersCountParameters struct {
// Unique identifier for the target chat
ChatID int64 `json:"chat_id"`
}
// GetChatMembersCount get the number of members in a chat. Returns Int on
// success.
func (bot *Bot) GetChatMembersCount(chatID int64) (count int, err error) {
dst, err := json.Marshal(&GetChatMembersCountParameters{ChatID: chatID})
if err != nil {
return
}
resp, err := bot.request(dst, MethodGetChatMembersCount)
if err != nil {
return
}
err = json.Unmarshal(*resp.Result, &count)
return
}