❄ Christmas Ralsei
❄ Christmas Ralsei
DIAdiscord.js - Imagine an app
Created by ❄ Christmas Ralsei on 12/21/2023 in #djs-questions
Sending voice messages?
I assume that's a Discord API limitation?
5 replies
DIAdiscord.js - Imagine an app
Created by ❄ Christmas Ralsei on 8/22/2022 in #djs-questions
Gracefully stop the bot
Approximately 15 seconds between Refreshing volume message… and Setting offline presence…, and the only await inside refresh() is editing a message saved in a variable
15 replies
DIAdiscord.js - Imagine an app
Created by ❄ Christmas Ralsei on 8/22/2022 in #djs-questions
Gracefully stop the bot
let exitHandled = false;
async function exitHandler() {
try {
if (exitHandled) return;
exitHandled = true;
console.log("Handling exit…");
disableAllButtons = true;
console.debug("Refreshing volume message…");
await refresh();
console.debug("Setting offline presence…");
client.user!.setPresence({
status: "invisible"
});
await Utils.delay(1000);
console.debug("Destroying the client…");
await client.destroy();
console.log("Handled.");
} catch(e) {
console.error(e);
} finally {
process.exit(0);
}
}
let exitHandled = false;
async function exitHandler() {
try {
if (exitHandled) return;
exitHandled = true;
console.log("Handling exit…");
disableAllButtons = true;
console.debug("Refreshing volume message…");
await refresh();
console.debug("Setting offline presence…");
client.user!.setPresence({
status: "invisible"
});
await Utils.delay(1000);
console.debug("Destroying the client…");
await client.destroy();
console.log("Handled.");
} catch(e) {
console.error(e);
} finally {
process.exit(0);
}
}
this is the handler
15 replies
DIAdiscord.js - Imagine an app
Created by ❄ Christmas Ralsei on 8/22/2022 in #djs-questions
Gracefully stop the bot
There's another weird thing: editing a message in the exit handler takes around 15 seconds…
15 replies
DIAdiscord.js - Imagine an app
Created by ❄ Christmas Ralsei on 8/22/2022 in #djs-questions
Gracefully stop the bot
Ws? As in websockets?
15 replies
DIAdiscord.js - Imagine an app
Created by ❄ Christmas Ralsei on 8/22/2022 in #djs-questions
Gracefully stop the bot
I tried to await another API thing before destroying the client (force fetching the client user, to be exact), but the bot still didn't immediately switch to offline after stopping it
15 replies
DIAdiscord.js - Imagine an app
Created by ❄ Christmas Ralsei on 8/22/2022 in #djs-questions
Gracefully stop the bot
(discord.js/typings/index.d.ts)
15 replies
DIAdiscord.js - Imagine an app
Created by ❄ Christmas Ralsei on 8/22/2022 in #djs-questions
Gracefully stop the bot
15 replies
DIAdiscord.js - Imagine an app
Created by ❄ Christmas Ralsei on 8/22/2022 in #djs-questions
Gracefully stop the bot
setPresence does not return a Promise, it returns the presence synchronically, looking at the type definitions…
15 replies
DIAdiscord.js - Imagine an app
Created by ❄ Christmas Ralsei on 8/22/2022 in #djs-questions
Embeds not added to the message
Uhh, seems it was due to it not having the permission to post embeds, but… why doesn't it throw an error describing that and just quietly failing?
6 replies
DIAdiscord.js - Imagine an app
Created by ❄ Christmas Ralsei on 8/22/2022 in #djs-questions
Embeds not added to the message
Node.js v17.5.0
Node.js v17.5.0
6 replies
DIAdiscord.js - Imagine an app
Created by ❄ Christmas Ralsei on 8/5/2022 in #djs-questions
`defaultMemberPermissions` not working
11 replies
DIAdiscord.js - Imagine an app
Created by ❄ Christmas Ralsei on 8/5/2022 in #djs-questions
`defaultMemberPermissions` not working
Everything is above ↑
11 replies