In 3 Glitch projects, a specific Promise does not “resolve” and stays in “pending” status forever.
I tested the same code 5 times: 4 Glitch projects and hosted in my computer.
The Promise worked as expected only in 1 Glitch project and in my pc.
client.on("ready", async () => {
console.log(`Ready for ${client.users.size} users.`);
var role = client.guilds.get("532013812900036618").roles.get("549972568195727371");
console.log("m0 ", role.name);
await role.setMentionable(true, "test1"); //problem is here
console.log("m1 ", role.mentionable);
let chat_log = client.channels.get("537086106408321024");
await chat_log.send("I am online! <@&549972568195727371>");
await role.setMentionable(false, "test2");
console.log("m2 ", role.mentionable);
});
The “m1” and “m2” messages doesn’t log because the first await
does not resolve.
All other promises are working as expected, and only this one is being problematic.
I tried everything to try to get around the problem, but I didn’t find out the cause or how to solve it.
I tried on Eris API, and the problem goes on. I accept help…
EDIT: Apparently the problem is “gone”.