hdkv
/
fwzookeeper
Archived
1
Fork 0
This repository has been archived on 2022-11-04. You can view files and clone it, but cannot push or open issues/pull-requests.
fwzookeeper/vendor/gitlab.com/toby3d/telegram/get_chat_members_count.go

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
}