Amazebot / bbot

An adaptable conversation engine for building bespoke bots.
MIT License
55 stars 2 forks source link

Some fields not being passed #106

Open ubarsaiyan opened 5 years ago

ubarsaiyan commented 5 years ago

The title_link field is not being sent even when I am passing custom JSON.

b.respond({
    title: 'Lauri M(title field)',
    title_link: 'https://www.basketball-reference.com/players/m/markkla01.html',
    text: 'Should have been rookie of the year (text field)',
    description: 'What a great player! (description field)',
    image_url: 'http://www.trbimg.com/img-5b04c449/turbine/ct-spt-bulls-lauri-markkanen-all-rookie-team-20180522',
  })

This gets converted to:

info:   [sendMessage] Calling (async): [{"rid":"aLFg7rGmfqFiNAcHnzoEaMyJ8LAtXrHHeK","attachments":[{"title":"Lauri M(title field)","text":"Should have been rookie of the year (text field)","description":"What a great player! (description field)","image_url":"http://www.trbimg.com/img-5b04c449/turbine/ct-spt-bulls-lauri-markkanen-all-rookie-team-20180522"}],"bot":{"i":"js.SDK"}}]

and the title_link field is lost. Same happens when using the payload.custom method. And why does the JSON within attachments by default? What if I want to pass a custom field outside of attachments object.

I am using bbot v1.3.2