ligh7hau5/commands/fediverse/unreblog.js

15 lines
432 B
JavaScript
Raw Normal View History

exports.runQuery = function (roomId, event, userInput) {
axios({
method: 'POST',
url: `${config.fediverse.domain}/api/v1/statuses/${userInput}/unreblog`,
headers: { Authorization: `Bearer ${fediverse.auth.access_token}` },
})
.then(() => {
matrix.utils.addReact(event, '✅');
})
.catch((e) => {
matrix.utils.addReact(event, '❌');
matrix.utils.sendError(event, roomId, e);
});
};