Skip to content

Commit

Permalink
feat: Added VCard to a contact message + doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
trakhimenok committed Sep 4, 2024
1 parent cddcada commit f135284
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
22 changes: 17 additions & 5 deletions tgbotapi/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,25 @@ type Voice struct {
}

// Contact contains information about a contact.
//
// Note that LastName and UserID may be empty.
// Note that LastName, UserID, VCard may be empty.
type Contact struct {

// PhoneNumber must always be presented
PhoneNumber string `json:"phone_number"`
FirstName string `json:"first_name"`
LastName string `json:"last_name,omitempty"` // optional
UserID int `json:"user_id,omitempty"` // optional

// FirstName must always be presented
FirstName string `json:"first_name"`

// Optional
LastName string `json:"last_name,omitempty"` // optional

// UserID (optional) is a Contact's user identifier in Telegram.
// It has at most 52 significant bits,
// so a 64-bit integer or double-precision float type are safe for storing this identifier.
UserID int64 `json:"user_id,omitempty"` // optional

// VCard (optional) additional data about the contact in the form of https://en.wikipedia.org/wiki/VCard
VCard string `json:"vcard,omitempty"`
}

// Location contains information about a place.
Expand Down
2 changes: 1 addition & 1 deletion tgbotapi/types_ffjson.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f135284

Please sign in to comment.