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:"-"`
|
||||
|
@ -27,7 +27,7 @@ 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"}
|
||||
defaultProfileFields = []string{"name", "first_name", "last_name", "profile_pic"}
|
||||
)
|
||||
|
||||
// Options are the settings used when creating a Messenger client.
|
||||
@ -158,12 +158,10 @@ func (m *Messenger) Handler() http.Handler {
|
||||
// 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