TypeError [INVALID_TYPE] Supplied parameter is not a User nor a Role.

This error occurs when I'm using TextChannel.permissionsOverwrite.set()
13 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Hax
Hax2y ago
Here's the code
Parogo_72
Parogo_722y ago
One of those isnt a valid id
Hax
Hax2y ago
Yes, that's my thought at first But I double checked and all are valid ticketcreator is a User ID interaction.values[0] is a Role ID member.guild.id is a Guild ID, but it is also the Role ID for @ everyone
Parogo_72
Parogo_722y ago
Log the values
Hax
Hax2y ago
I did logged it And use <@&> And <@> To double checked, all are valid This also happens at very random timing
Parogo_72
Parogo_722y ago
Wdym random timing
Hax
Hax2y ago
It works like 50% of the time
Parogo_72
Parogo_722y ago
My guess is that interaction.values[0] is the issue Since you can unselect things from a select menu Making it undefined You should make the array outside the .set and check the values before pushing the elements to it
Hax
Hax2y ago
Oh hm When I log it, I don't see undefined though I see
Parogo_72
Parogo_722y ago
But do you log it when it errors?
Hax
Hax2y ago
Okay, I do see what you mean now. It works when I picked another value