ligh7hau5/commands/fediverse/status.js

16 lines
471 B
JavaScript
Raw Normal View History

exports.runQuery = function (roomId, event, userInput) {
2020-07-03 20:05:39 +03:00
axios({
method: 'GET',
url: `${config.fediverse.domain}/api/v1/statuses/${userInput}`,
headers: { Authorization: `Bearer ${fediverse.auth.access_token}` },
})
.then((response) => {
response.label = 'status';
fediverse.utils.formatter(response, roomId);
})
.catch((e) => {
matrix.utils.addReact(event, '❌');
matrix.utils.sendError(event, roomId, e);
2020-07-03 20:05:39 +03:00
});
};