ligh7hau5/commands/fediverse/redact.js

18 lines
528 B
JavaScript
Raw Normal View History

2019-07-04 00:27:39 +03:00
const axios = require('axios');
exports.runQuery = function (matrixClient, room, userInput, registrar) {
axios({
method: 'DELETE',
2020-06-28 10:07:58 +03:00
url: `${registrar.config.fediverse.domain}/api/v1/statuses/${userInput}`,
headers: { Authorization: `Bearer ${registrar.fediverse_auth.access_token}` },
2019-07-04 00:27:39 +03:00
}).then((response) => {
matrixClient.sendHtmlNotice(room.roomId,
'',
'<blockquote>Redacted.</blockquote');
})
.catch((e) => {
matrixClient.sendHtmlNotice(room.roomId,
'', `${e}`);
});
};