broidHQ / broid-kit

Bot framework powered by Broid
Other
60 stars 9 forks source link

Fixed return type of method on #28

Closed tenorok closed 6 years ago

tenorok commented 6 years ago

It was a typescript error:

bot.on('Person').subscribe((data) => {
  data // type is IActivityStream
  data.message // error, because this property is missing in IActivityStream
});

In fact, data is object like below:

{
  "data": [],
  "message": {
    "@context": "https://www.w3.org/ns/activitystreams",
    "generator": {
      "id": "45c061a7-945d-4f7c-8e09-e28162b0d",
      "name": "telegram",
      "type": "Service"
    },
    "published": 1515652,
    "type": "Create",
    "actor": {
      "id": "63580",
      "name": "Artem Kurbatov",
      "type": "Person"
    },
    "target": {
      "id": "63580",
      "name": "Artem Kurbatov",
      "type": "Person"
    },
    "object": {
      "content": "text",
      "id": "243",
      "type": "Note"
    }
  }
}
CLAassistant commented 6 years ago

CLA assistant check
All committers have signed the CLA.

tenorok commented 6 years ago

Anybody here?

killix commented 6 years ago

thanks for the PR @tenorok