text: const permissions = require("../../utils/permissions.js")
  
  module.exports = async d => {
      const code = d.command.code
  
      const r = code.split("$hasPerms[").length - 1
  
      const inside = code.split("$hasPerms[")[r].split("]")[0]
  
      const fields = inside.split(";")
  
      const userID = fields.shift()
  
      const member = await d.message.guild.members.fetch(userID).catch(err => {})
  
      if (!member) return d.error(`:x: Invalid user ID in \`$hasPerms[${inside}]\``)
  
      const reqPerms = []
  
      for (const field of fields) {
          const perm = permissions[field]
  
          if (!perm) return d.error(`:x: Invalid perm '${field}' in \`$hasPerms[${inside}]\``)
  
          else reqPerms.push(perm)
      } 
  
      return {
          code: code.replaceLast(`$hasPerms[${inside}]`, member.hasPermission(reqPerms))
      }
  }