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_member.go

34 lines
796 B
Go

package telegram
import json "github.com/pquerna/ffjson/ffjson"
// GetChatMemberParameters represents data for GetChatMember method.
type GetChatMemberParameters struct {
// Unique identifier for the target chat
ChatID int64 `json:"chat_id"`
// Unique identifier of the target user
UserID int `json:"user_id"`
}
// GetChatMember get information about a member of a chat. Returns a ChatMember
// object on success.
func (bot *Bot) GetChatMember(chatID int64, userID int) (member *ChatMember, err error) {
dst, err := json.Marshal(&GetChatMemberParameters{
ChatID: chatID,
UserID: userID,
})
if err != nil {
return
}
resp, err := bot.request(dst, MethodGetChatMember)
if err != nil {
return
}
member = new(ChatMember)
err = json.Unmarshal(*resp.Result, member)
return
}