Check Ban list

Hello, Is it possible to check if a person is already in the ban list? I looked on the internet but nothing worked (maybe I made a mistake). For the moment I have this code that allows to ban a person only if he has the ban permissions (otherwise there is a message Missing Permissions)
6 Replies
d.js toolkit
d.js toolkit16mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - 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!
d.js docs
d.js docs16mo ago
method GuildBanManager#fetch() Fetches ban(s) from Discord.
Skully
SkullyOP16mo ago
Thank you. And in what way is it best to ban a user between these two formats?
Skully
SkullyOP16mo ago
Between guild.members.ban and guild.bans.create Thank you. And if I want to add a reason to the ban with guild.members.ban, I have to write it like this?
guild.members.ban(user, [
.reason: 'somethings'
])
guild.members.ban(user, [
.reason: 'somethings'
])
So this way it's okay ?
guild.members.ban(user, {
.reason: 'somethings'
})
guild.members.ban(user, {
.reason: 'somethings'
})
Skully
SkullyOP16mo ago
the . was a mistake sorry I thought they were [] because that's what it says in the doc. Thank you very much for your help
Skully
SkullyOP16mo ago
Okay, I understand. Thank you very much for your help
Want results from more Discord servers?
Add your server