如何显示不同的权限名称? 例如:MANAGE_ROLES >> управлять ролями 我将在此处的查询中使用它,我尝试自己尝试但我不能。
const {MessageEmbed} = require('discord.js');
const {allYour} = require('aybabtu');
module.exports = async(client,brole,arole)=>{
try{
const fetchLogs = await brole.guild.fetchAuditLogs({
limit: 1,
type: 'ROLE_UPDATE'
});
const log = fetchLogs.entries.first();
const {executor} = log;
if(brole.rawPosition !== arole.rawPosition) return;
const embed = new MessageEmbed()
.setColor(arole.color || 'RANDOM')
.setAuthor(`? Rol Güncellendi! ?`,executor.avatarURL())
.setDescription(
`**Update by >>** <@${executor.id}>`)
.setTimestamp()
.addField(`${names["USE_VAD"]}`)
.addFields({
name: '> Before:',
value: `**Rol Adı >>** ${brole.name}
**Renk >>** #${allYour('decimal').areBelongTo('hexdecimal')(brole.color)}
**Etiket Aktif? >>** ${brole.mentionable}
**Yetkiler** \n\ ${
brole.permissions.toArray().join('\n') || 'No Perms'}\
`,
inline: true,
},{
name: '> After:',
value: `**Rol Adı >>** ${arole.name}
**Renk >>** #${allYour('decimal').areBelongTo('hexdecimal')(arole.color)}
**Etiket Aktif? >>** ${arole.mentionable}
**Yetkiler** \n\ ${
arole.permissions.toArray().join('\n') || 'No Perms'}\
`,
inline: true,
});
brole.guild.channels.cache
.find((channel)=>channel.name==='discord-log')
.send(embed)
}catch(err){
console.log(err);
}
}