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"
|
import "time"
|
||||||
|
|
||||||
// Message represents a Facebook messenge message.
|
// Message represents a Facebook messenger message.
|
||||||
type Message struct {
|
type Message struct {
|
||||||
// Sender is who the message was sent from.
|
// Sender is who the message was sent from.
|
||||||
Sender Sender `json:"-"`
|
Sender Sender `json:"-"`
|
||||||
|
10
messenger.go
10
messenger.go
@ -26,8 +26,8 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// NOTE: If you change this slice you should update the comment on the ProfileByID function below too.
|
// 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.
|
// 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
|
// ProfileByID retrieves the Facebook user profile associated with that ID
|
||||||
// when no profile fields are specified it uses some sane defaults.
|
// when no profile fields are specified it uses some sane defaults.
|
||||||
//
|
//
|
||||||
// These default fields are:
|
// These default fields are:
|
||||||
|
// - Name
|
||||||
// - First name
|
// - First name
|
||||||
// - Last name
|
// - Last name
|
||||||
// - Profile picture
|
// - Profile picture
|
||||||
// - Locale
|
|
||||||
// - Timezone
|
|
||||||
// - Gender
|
|
||||||
func (m *Messenger) ProfileByID(id int64, profileFields ...string) (Profile, error) {
|
func (m *Messenger) ProfileByID(id int64, profileFields ...string) (Profile, error) {
|
||||||
p := Profile{}
|
p := Profile{}
|
||||||
url := fmt.Sprintf("%v%v", ProfileURL, id)
|
url := fmt.Sprintf("%v%v", ProfileURL, id)
|
||||||
|
@ -2,6 +2,7 @@ package messenger
|
|||||||
|
|
||||||
// Profile is the public information of a Facebook user
|
// Profile is the public information of a Facebook user
|
||||||
type Profile struct {
|
type Profile struct {
|
||||||
|
Name string `json:"name"`
|
||||||
FirstName string `json:"first_name"`
|
FirstName string `json:"first_name"`
|
||||||
LastName string `json:"last_name"`
|
LastName string `json:"last_name"`
|
||||||
ProfilePicURL string `json:"profile_pic"`
|
ProfilePicURL string `json:"profile_pic"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user