release 0.1.0
This commit is contained in:
parent
4b3ba6b516
commit
35b4509238
18 changed files with 399 additions and 1 deletions
20
commands/unfren.js
Normal file
20
commands/unfren.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
const axios = require('axios');
|
||||
|
||||
exports.runQuery = function (matrixClient, room, userInput, registrar) {
|
||||
axios.get(`${registrar.config.fediverse}/api/v1/accounts/${userInput}`).then((findUID) => {
|
||||
axios({
|
||||
method: 'POST',
|
||||
url: `${registrar.config.fediverse}/api/v1/accounts/${findUID.data.id}/unfollow`,
|
||||
headers: { Authorization: `Bearer ${registrar.config.fediverseToken}` },
|
||||
})
|
||||
.then((response) => {
|
||||
matrixClient.sendHtmlNotice(room.roomId,
|
||||
'',
|
||||
`Unsubscribed:
|
||||
<blockquote>${registrar.config.fediverse}/${response.data.id}`);
|
||||
});
|
||||
}).catch((e) => {
|
||||
matrixClient.sendHtmlNotice(room.roomId,
|
||||
'', `${e}`);
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue