Check if user that sent a message have permission

How can i check if the bot have a specific permission on the server?

I was using if (msg.member.permissions.has("USE_APPLICATION_COMMANDS")) but its giving me Cannot read properties of null (reading 'permissions')
Was this page helpful?