#incident-actions
26 messages · Page 1 of 1 (latest)
- What's your exact discord.js
npm list discord.jsand nodenode -vversion? - Not a discord.js issue? Check out #1081585952654360687.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
Those are guild features, so you need to Guild#edit() and add that feature
Guild#edit()
Updates the guild with new information - e.g. a new name.
Oh wait, no, that‘s only for InvitesDisabled. I don’t believe DMDisabled is possible through bot yet. Mb
yea it's possible
currently discord.js doesn't have a method for those endpoint, you can call <Client>.rest.put("/guilds/{guildId}/incident-actions", { body }); for now
- Note: the endpoint only available for community-enabled server
Because it‘s not a documented endpoint… so still subject to change
true
Thanks, so it's like my attached screenshot 😄
i didn't know i can call rest directly, thanks for that!
So if I want to block PM for 24h, it should look like this?
const now = new Date();
const tomorrow = new Date(now.getTime() + (24 * 60 * 60 * 1000));
const isoTimestamp = tomorrow.toISOString();
const body = {
"dms_disabled_until": isoTimestamp
};
client.rest.put("/guilds/{guildId}/incident-actions", { body } );
you forgot to close the endpoint string, but yeah, try it and see if it works or not
"/guilds/{guildId}/incident-actions```
you're right
I would let this post open, that maybe it can be updated when discord.js has integrated this feature? 🙂
It would have to be documented by discord for that to happen first
still wrong btw
yeah
I was happy that automod is already documented
but was still a pain to create the commands to create ones 😄
what 😦
this is.. invalid endpoint
"/guilds/{guildId}/incident-actions, body: { body }"```
do i need to close it after ..-actions?
yeah, and you should just pass { body } as the second param
damn, thanks 😄
np
like this?
await client.rest.put("/guilds/{guildId}/incident-actions", { body });```
yeah changed it already after asking you 😄