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