2021-02-14 15:57:35 +08:00
|
|
|
exports.runQuery = function (roomId, event, userInput) {
|
2020-07-04 01:05:39 +08:00
|
|
|
axios({
|
|
|
|
method: 'GET',
|
2021-02-01 16:58:59 +08:00
|
|
|
url: `${config.fediverse.domain}/api/v1/statuses/${userInput}`,
|
2021-02-14 15:57:35 +08:00
|
|
|
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-04 01:05:39 +08:00
|
|
|
});
|
|
|
|
};
|