This script will cycle all servers you're in and mark them all as read! Just run
npm install request
node markasread.js <your discord token>
var token = "idk" | |
console.log("> Hello.") | |
var base = "https://discordapp.com/api/v6" | |
const request = require("request") | |
if (process.argv[2] != undefined) { | |
token = process.argv[2] | |
console.log(" -> Using provided token") | |
}else {console.log(" -> Using default token")} | |
console.log("> Getting guilds...") | |
request({ | |
"url": base + "/users/@me/guilds", | |
"headers": { | |
"authorization": token | |
} | |
}, (error, resp, body) => { | |
if (error) { | |
console.error(error) | |
}else { | |
if (resp.statusCode == 200) { | |
markAllRead(JSON.parse(body)) | |
}else { | |
console.log(" -> Authentication (probably) failed.") | |
} | |
} | |
}) | |
function markAllRead(guilds) { | |
console.log(" -> Got " + guilds.length + " guilds.\n> ACK'ing all guilds\n -> This will take " + guilds.length + " seconds.") | |
// gotta go slow. (1/second) | |
var loops = 0 | |
var interations = guilds.length | |
var canContinue = true; | |
var failed = 0 | |
var markasread = setInterval(() => { | |
var guild = guilds[loops] | |
if (canContinue) { | |
console.log(" -> ACK: " + guild["name"] + "(" + guild["id"] + ")") | |
canContinue = false; | |
request.post(base + "/guilds/" + guild["id"] + "/ack", { | |
"headers": {"authorization": token} | |
}, (error, resp, body) => { | |
if (error) { | |
console.error(error) | |
}else { | |
canContinue = true; | |
if (resp.statusCode == 204) { | |
console.log(" -> OK!") | |
failed = 0 | |
}else { | |
console.log(" -> FAIL! (" + resp.statusCode + ")") | |
console.log(body) | |
} | |
} | |
}) | |
}else {console.log(" -> Waiting for network...") | |
failed++} | |
if (failed == 10) { | |
console.error("> Exit\n -> Suspected network fault.") | |
process.exit(1) | |
} | |
if (canContinue) {loops++} | |
if (loops == interations) { | |
console.log("-> TIME! \n --> All done!") | |
clearInterval(markasread) | |
} | |
}, 1000) | |
} |
is it possible to specifically mark a message as read? the message should include a reply mention or a @ mention
@T-byte-sketch - you can mark as read in Discord, it's in the inbox tray -> unread -> Mark Inbox as Read
I suppose I could re-make it, but when it's there in the normal client I don't think it's worth it honestly.