Ban command
I seem to be having this issue when trying to ban someone outside the server I have been trying to find a way to ban outside the server for a bit but could not do it Here is my code https://pastebin.com/Kw7GQbWt
Pastebin
const Discord = require('discord.js');module.exports = async (clien...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
12 Replies
- 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!guild.bans.create()
Would I do this on Line 11?
35 I believe
oh yes
also, you can use interaction.options.getMember() instead of fetching them
This is on line 11 assume
for
const member = await interaction.guild.members.fetch(interaction.options.getUser('user').id);
Pastebin
const Discord = require('discord.js');module.exports = async (clien...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
DiscordAPIError[10007]: Unknown Member
at handleErrors (/app/node_modules/@discordjs/rest/dist/index.js:687:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.runRequest (/app/node_modules/@discordjs/rest/dist/index.js:1072:23)
at async SequentialHandler.queueRequest (/app/node_modules/@discordjs/rest/dist/index.js:913:14)
at async _REST.request (/app/node_modules/@discordjs/rest/dist/index.js:1218:22)
at async GuildMemberManager._fetchSingle (/app/node_modules/discord.js/src/managers/GuildMemberManager.js:221:18)
at async module.exports (/app/src/commands/moderation/ban.js:11:18)
and this error TypeError: Cannot read properties of null (reading 'id')
at module.exports (/app/src/commands/moderation/ban.js:11:93)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
But yea I don't know what else to do here, sorry for bothering you. and thanks for the help?Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
For the <Guild> part what do I do with that? I forgot to mention this is soon gonna be a public bot?
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View