1
0
mirror of synced 2024-11-21 20:36:06 +03:00

change the default user profile fields; fix minor typo

This commit is contained in:
Ayomide Onigbinde 2018-12-30 13:37:18 +01:00
parent 7fbedb40b4
commit 8d546920cd
3 changed files with 6 additions and 7 deletions

View File

@ -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:"-"`

View File

@ -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)

View File

@ -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"`