const axios = require("axios");
const { setTimeout } = require("timers/promises");
const HOST = "https://rdrama.net";
const REPLY_URL = `${HOST}/reply`;
const UNREAD_URL = `${HOST}/unread`;
const REPLY_MESSAGE = ":marse#ykys:";
const ACCESS_TOKEN = "YOUR_TOKEN_HERE";
async function execute() {
while (true) {
const config = { headers: { Authorization: ACCESS_TOKEN } };
console.log("CHECKING UNREADS");
const response = await axios.get(UNREAD_URL, config);
for (const unread of response.data.data) {
console.log("FOUND UNREAD\n", unread.author_name);
if (unread.author_name === "SomeStupidAsshole") {
const form = new FormData();
form.append("parent_id", unread.id);
form.append("body", REPLY_MESSAGE);
await axios.post(REPLY_URL, form, config);
console.log("SENT REPLY");
}
}
await setTimeout(60000);
}
}
execute().then(() => process.exit(0));
If you don't know how to into Javascript, reply here. This site doesn't yet allow you to check DMs without marking them as read, so I won't see any DMs while this script is needful for me
Jump in the discussion.
No email address required.
Uh-oh, recursion!
Jump in the discussion.
No email address required.
More options
Context