#incident-actions

26 messages · Page 1 of 1 (latest)

grim glen
#

Does discord.js already include the function to enable the incident-actions like "Disable PM for 24h"?

If yes, can some provide me how it works? 🙂

grand warrenBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • 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!
little flame
#

Those are guild features, so you need to Guild#edit() and add that feature

graceful rockBOT
#

method Guild#edit()
Updates the guild with new information - e.g. a new name.

little flame
#

Oh wait, no, that‘s only for InvitesDisabled. I don’t believe DMDisabled is possible through bot yet. Mb

thick lagoon
little flame
#

Because it‘s not a documented endpoint… so still subject to change

thick lagoon
#

true

grim glen
#

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 } );
thick lagoon
grim glen
#

you're right

#

I would let this post open, that maybe it can be updated when discord.js has integrated this feature? 🙂

little flame
#

It would have to be documented by discord for that to happen first

grim glen
grim glen
thick lagoon
grim glen
#

do i need to close it after ..-actions?

thick lagoon
grim glen
#

damn, thanks 😄

thick lagoon
thick lagoon
grim glen
#

yeah changed it already after asking you 😄