update recipient (#8)
This commit is contained in:
parent
3033380a29
commit
ec6ddfd1cb
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: ['1.11', '1.12', '1.13', '1.14', '1.15']
|
||||
go-version: ['1.11', '1.12', '1.13', '1.14', '1.15', '1.16', '1.17']
|
||||
steps:
|
||||
- name: Set up Go ${{ matrix.go-version }}
|
||||
uses: actions/setup-go@v2
|
||||
|
@ -374,7 +374,7 @@ func (m *Messenger) dispatch(r Receive) {
|
||||
}
|
||||
|
||||
resp := &Response{
|
||||
to: Recipient{info.Sender.ID},
|
||||
to: Recipient{ID: info.Sender.ID},
|
||||
token: m.token,
|
||||
sendAPIVersion: m.sendAPIVersion,
|
||||
}
|
||||
@ -436,7 +436,7 @@ func (m *Messenger) dispatch(r Receive) {
|
||||
// Response returns new Response object.
|
||||
func (m *Messenger) Response(to int64) *Response {
|
||||
return &Response{
|
||||
to: Recipient{to},
|
||||
to: Recipient{ID: to},
|
||||
token: m.token,
|
||||
sendAPIVersion: m.sendAPIVersion,
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ func TestMessenger_Dispatch(t *testing.T) {
|
||||
messages := []MessageInfo{
|
||||
{
|
||||
Sender: Sender{111},
|
||||
Recipient: Recipient{222},
|
||||
Recipient: Recipient{ID: 222},
|
||||
// 2018-11-24 21:31:51 UTC + 999ms
|
||||
Timestamp: 1543095111999,
|
||||
Message: &Message{},
|
||||
@ -138,7 +138,7 @@ func TestMessenger_Dispatch(t *testing.T) {
|
||||
messages := []MessageInfo{
|
||||
{
|
||||
Sender: Sender{111},
|
||||
Recipient: Recipient{222},
|
||||
Recipient: Recipient{ID: 222},
|
||||
// 2018-11-24 21:31:51 UTC + 999ms
|
||||
Timestamp: 1543095111999,
|
||||
Delivery: &Delivery{},
|
||||
@ -170,7 +170,7 @@ func TestMessenger_Dispatch(t *testing.T) {
|
||||
messages := []MessageInfo{
|
||||
{
|
||||
Sender: Sender{111},
|
||||
Recipient: Recipient{222},
|
||||
Recipient: Recipient{ID: 222},
|
||||
// 2018-11-24 21:31:51 UTC + 999ms
|
||||
Timestamp: 1543095111999,
|
||||
Read: &Read{},
|
||||
@ -205,7 +205,7 @@ func TestMessenger_Dispatch(t *testing.T) {
|
||||
messages := []MessageInfo{
|
||||
{
|
||||
Sender: Sender{111},
|
||||
Recipient: Recipient{222},
|
||||
Recipient: Recipient{ID: 222},
|
||||
// 2018-11-24 21:31:51 UTC + 999ms
|
||||
Timestamp: 1543095111999,
|
||||
PostBack: &PostBack{},
|
||||
@ -240,7 +240,7 @@ func TestMessenger_Dispatch(t *testing.T) {
|
||||
messages := []MessageInfo{
|
||||
{
|
||||
Sender: Sender{111},
|
||||
Recipient: Recipient{222},
|
||||
Recipient: Recipient{ID: 222},
|
||||
// 2018-11-24 21:31:51 UTC + 999ms
|
||||
Timestamp: 1543095111999,
|
||||
OptIn: &OptIn{},
|
||||
@ -275,7 +275,7 @@ func TestMessenger_Dispatch(t *testing.T) {
|
||||
messages := []MessageInfo{
|
||||
{
|
||||
Sender: Sender{111},
|
||||
Recipient: Recipient{222},
|
||||
Recipient: Recipient{ID: 222},
|
||||
// 2018-11-24 21:31:51 UTC + 999ms
|
||||
Timestamp: 1543095111999,
|
||||
ReferralMessage: &ReferralMessage{},
|
||||
|
@ -87,7 +87,9 @@ type Sender struct {
|
||||
|
||||
// Recipient is who the message was sent to.
|
||||
type Recipient struct {
|
||||
ID int64 `json:"id,string"`
|
||||
ID int64 `json:"id,string,omitempty"`
|
||||
PostID string `json:"post_id,omitempty"`
|
||||
CommentID string `json:"comment_id,omitempty"`
|
||||
}
|
||||
|
||||
// Attachment is a file which used in a message.
|
||||
|
Loading…
Reference in New Issue
Block a user