How can I ban people with my bot who are outside of the server?

I’ve managed to do a guild command but I cannot manage to make it so I can ban people outside of the guild, how do can I make it do that?
3 Replies
d.js toolkit
d.js toolkit3mo 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! - Marked as resolved by staff
d.js docs
d.js docs3mo ago
:method: GuildBanManager#create() @14.16.2 Bans a user from the guild.
// Ban a user by id (or with a user/guild member object)
guild.bans.create('84484653687267328')
.then(banInfo => console.log(`Banned ${banInfo.user?.tag ?? banInfo.tag ?? banInfo}`))
.catch(console.error);
// Ban a user by id (or with a user/guild member object)
guild.bans.create('84484653687267328')
.then(banInfo => console.log(`Banned ${banInfo.user?.tag ?? banInfo.tag ?? banInfo}`))
.catch(console.error);
:property: Guild#bans @14.16.2 A manager of the bans belonging to this guild
Sheepboi546
Sheepboi546OP3mo ago
Thank you
Want results from more Discord servers?
Add your server