ligh7hau5/commands/fediverse/tip.js
vulet 42563ebc35 feat(matrix/fediverse): allow users to directly reply on Fediverse posts from Matrix, using <mx-reply> on our new meta field.
feat(matrix/fediverse): allow users to favorite, reblog, and redact Fediverse posts from Matrix, using m.reaction on our new meta field.
feat(fediverse): add suggestions for follow/unfollow commands.
refactor(matrix/fediverse): add meta field for commands by reaction, and commands by reply.
refactor(fediverse): relax polling on timeline/notifs thru new handling.
2021-02-14 15:57:35 +08:00

15 lines
498 B
JavaScript

exports.runQuery = function (roomId, address, flaggedInput, event) {
axios({
method: 'POST',
url: `${config.fediverse.domain}/api/v1/statuses`,
headers: { Authorization: `Bearer ${fediverse.auth.access_token}` },
data: { status: `@10grans@fedi.cc tip ${flaggedInput} to ${address}` },
})
.then(() => {
matrix.utils.addReact(event, '✅');
})
.catch((e) => {
matrix.utils.addReact(event, '❌');
matrix.utils.sendError(event, roomId, e);
});
};