chat: update all types

pull/271/head
Demian 4 years ago
parent 9087ce99d0
commit a96aa24503

@ -2,7 +2,7 @@ package telebot
import "strconv"
// User object represents a Telegram user, bot
// User object represents a Telegram user, bot.
type User struct {
ID int `json:"id"`
@ -11,6 +11,11 @@ type User struct {
Username string `json:"username"`
LanguageCode string `json:"language_code"`
IsBot bool `json:"is_bot"`
// Returns only in getMe
CanJoinGroups bool `json:"can_join_groups"`
CanReadMessages bool `json:"can_read_all_group_messages"`
SupportsInline bool `json:"supports_inline_queries"`
}
// Recipient returns user ID (see Recipient interface).
@ -31,6 +36,27 @@ type Chat struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Username string `json:"username"`
// Returns only in getChat
Photo *ChatPhoto `json:"photo,omitempty"`
Description string `json:"description,omitempty"`
InviteLink string `json:"invite_link,omitempty"`
PinnedMessage *Message `json:"pinned_message,omitempty"`
Permissions *Rights `json:"permissions,omitempty"`
SlowMode int `json:"slow_mode_delay,omitempty"`
StickerSet string `json:"sticker_set_name,omitempty"`
CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"`
}
// ChatPhoto object represents a chat photo.
type ChatPhoto struct {
// File identifiers of small (160x160) chat photo
SmallFileID string `json:"small_file_id"`
SmallFileUniqueID string `json:"small_file_unique_id"`
// File identifiers of big (640x640) chat photo
BigFileID string `json:"big_file_id"`
BigFileUniqueID string `json:"big_file_unique_id"`
}
// Recipient returns chat ID (see Recipient interface).
@ -42,8 +68,9 @@ func (c *Chat) Recipient() string {
type ChatMember struct {
Rights
User *User `json:"user"`
Role MemberStatus `json:"status"`
User *User `json:"user"`
Role MemberStatus `json:"status"`
Title string `json:"custom_title"`
// Date when restrictions will be lifted for the user, unix time.
//

Loading…
Cancel
Save