Skip to content
Advertisement

Why am I getting: TypeError: channel.updateOverwrite is not a function

I’m following a tutorial on discord.js, making a ticket bot. I have double-checked and I am still getting the same error:

TypeError: channel.updateOverwrite is not a function

I’ve looked over all the StackOverflow questions that I could find, but none has worked for me. I have also explored a little deeper outside of SO, still no help. Here is my code:

JavaScript

Advertisement

Answer

It seems you’re using discord.js v13 and trying some old code. In v13 the channel#updateOverwrite() method is removed and while in previous version channel#permissionOverwrites was a collection of overwrites, in v13 it’s a PermissionOverwriteManager. It means, you should use its .edit() method to update overwrites:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement