ligh7hau5/commands/fediverse/beg.js

20 lines
568 B
JavaScript
Raw Normal View History

exports.runQuery = function (matrixClient, room) {
2020-05-16 20:31:10 +03:00
axios({
method: 'POST',
url: `${config.fediverse.domain}/api/v1/statuses`,
headers: { Authorization: `Bearer ${fediverse_auth.access_token}` },
2020-05-16 20:31:10 +03:00
data: { status: `@10grans@fedi.cc beg` },
}).then((response) => {
matrixClient.sendHtmlNotice(room.roomId,
'',
`<b>
<blockquote><i>You have begged for 10grans.<br>
(id: ${response.data.id}</a>)
</blockquote><br>`);
})
.catch((e) => {
matrixClient.sendHtmlNotice(room.roomId,
'', `${e}`);
});
};