- What's your exact discord.js
npm list discord.jsand nodenode -vversion? - 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!
✅Marked as resolved by OP
#My unmute.js file isn't working
20 messages · Page 1 of 1 (latest)
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined
- All
SCREAMING_SNAKE_CASEenums have been changed toPascalCase - Intents:
Intents.FLAGS.GUILD_MESSAGES->GatewayIntentBits.GuildMessages - Permissions:
Permissions.FLAGS.SEND_MESSAGES->PermissionFlagsBits.SendMessages
@opal matrix ^
okay.
okay, but idk why my command isn't working. my unmute.js file's cpde: https://sourceb.in/iZTJTe7ghe and the mute.js's code: https://sourceb.in/wUdBBOgaI9
it says when I am trying to unmute somebody that is muted: the user isn't muted.
Because you didn’t change it properly
You just changed it to PermissionsBitField
Which isn’t correct either. It’s PermissionFlagsBits
PermissionsBitField.Flags is just fine. But you only did that in the mute command, in the unmute you stopped halfway with the .has check
Now I corrected everything: unmute.js: https://sourceb.in/iMdUP2Ypcb mute.js: https://sourceb.in/rhlnSEkKBc. But when I try to mute somebody it says: the user isn't muted (in hungarian )
Your mute code uses the native discord timeout feature. While your unmute code tries to remove a mute role. By an id that isn’t an actual id but text instead
but what should I add? Do I need database.. etc?
No. You need to make up your mind how you want your command to work.
- Should it use native discord timeout? Then your unmute should set timeout to null
- should it use a custom role? Then your unmute should remove that role
Currently you do a mix of both that doesn’t make any sense
mute.js:12 vs unmute.js:10
Ezt a kettőt nézd össze, ha kell olvasd el megint a dokumentációt.
Azt neked kell eldönteni, hogy ranghoz vagy flaghez kötöd a két funkciót.
Ne arra figyelj, hogy mit hallucinál neked az AI .. írj egy sudo kódot mielőtt nekiugrassz.
// Ez amit a mute.js-nél használtál.
const member = interaction.options.getMember('target');
member.timeout(60_000); // Egy perces némítás
const member = interaction.options.getMember('target');
member.timeout(null); // Egy perc felülírása == unmute
Remélem így már tiszta.
hey there @chrome scroll, this is an english only server. do your best to use a translator, but it doesn’t need to be perfect.
Fair enough, but leave it there for now.
okay, we use the same language.
I recommend using Discord's timeouts