Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
Discord.js ban duration

I have been struggling with this issue for quite some time

I wanna see what options I have for a ban duration. However

the official discord documentation is barebones on this subject

guildMember.ban({ days: 7, reason: 'They deserved it' })
  .then(console.log)
  .catch(console.error);

This code bans a guildmember for 7 days

But aside from days are there minutes ? Hours ? Etc ?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

It doesn't ban the member for 7 days. It just deletes 7 days of their messages. To actually ban them for ? days, ? minutes, ? hours, etc., you need to set a timer yourself (e.g. setTimeout, although the timer will be reset when you restart the bot).

about 4 years ago · Juan Pablo Isaza Report

0

Days is not the duration. Days specifies the days to delete messages in. Its like when you try to ban someone on discord, it gives you the option to select for how long you want to delete past messages. To implement a temp ban, you have to manually write code that unbans them.

Reference: https://discord.js.org/#/docs/main/stable/typedef/BanOptions

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!