xxxxxxxxxx
// final permissions for a guild member using permissionsFor
const botPermissionsFor = channel.permissionsFor(guild.me);
// final permissions for a guild member using permissionsIn
const botPermissionsIn = guild.me.permissionsIn(channel);
// final permissions for a role
const rolePermissions = channel.permissionsFor(role);
// Works for Discord.js v14
const { PermissionFlagsBits } = require('discord.js');
channel.permissionsFor(guild.members.me).has(PermissionFlagsBits.SendMessages)