change the default user profile fields; fix minor typo
This commit is contained in:
parent
7fbedb40b4
commit
8d546920cd
@ -2,7 +2,7 @@ package messenger
|
||||
|
||||
import "time"
|
||||
|
||||
// Message represents a Facebook messenge message.
|
||||
// Message represents a Facebook messenger message.
|
||||
type Message struct {
|
||||
// Sender is who the message was sent from.
|
||||
Sender Sender `json:"-"`
|
||||
|
10
messenger.go
10
messenger.go
@ -26,8 +26,8 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
// NOTE: If you change this slice you should update the comment on the ProfileByID function below too.
|
||||
defaultProfileFields = []string{"first_name", "last_name", "profile_pic", "locale", "timezone", "gender"}
|
||||
// NOTE: If you change this slice you should update the comment on the ProfileByID function below too.
|
||||
defaultProfileFields = []string{"name", "first_name", "last_name", "profile_pic"}
|
||||
)
|
||||
|
||||
// Options are the settings used when creating a Messenger client.
|
||||
@ -156,14 +156,12 @@ func (m *Messenger) Handler() http.Handler {
|
||||
|
||||
// ProfileByID retrieves the Facebook user profile associated with that ID
|
||||
// when no profile fields are specified it uses some sane defaults.
|
||||
//
|
||||
//
|
||||
// These default fields are:
|
||||
// - Name
|
||||
// - First name
|
||||
// - Last name
|
||||
// - Profile picture
|
||||
// - Locale
|
||||
// - Timezone
|
||||
// - Gender
|
||||
func (m *Messenger) ProfileByID(id int64, profileFields ...string) (Profile, error) {
|
||||
p := Profile{}
|
||||
url := fmt.Sprintf("%v%v", ProfileURL, id)
|
||||
|
@ -2,6 +2,7 @@ package messenger
|
||||
|
||||
// Profile is the public information of a Facebook user
|
||||
type Profile struct {
|
||||
Name string `json:"name"`
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
ProfilePicURL string `json:"profile_pic"`
|
||||
|
Loading…
Reference in New Issue
Block a user