BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@[email protected]

's Message object is backed by @fedify's Activity Vocabulary objects, and you can access it through the Message.raw property.

Want more?

If you want more data from the message, you can get the raw object of the message through the raw property. It is an instance of one of Article, ChatMessage, Note, or Question class (which are provided by Fedify). You can get the raw data from the object.

For example, if you want to get the location of the message (Pixelfed et al. provide the geo location of the message), you can get it through the raw property:

const location = await message.raw.getLocation();
if (location instanceof Place) {
  console.log(location.name);
  console.log(location.latitude);
  console.log(location.longitude);
}

In the above example, the Place class is declared by Fedify, so you need to install it and import it:

import { Place } from "@fedify/fedify/vocab";