Discord.js Permission Module keeps printing undefined

I created a permission module for my bot and cant see why it isn’t working. All I get is undefined printed in the console.

Command

 const guild = PermissionManager.fetchGuild(message.guild.id);
    const ClientPermissions = await PermissionManager.fetchPerms(client, message, 4);
    console.log(ClientPermissions);
    if (ClientPermissions == false) {
        PermissionManager.invalidPerms(message, 4);
    } else { // execute command 
}

Permission Module

if (level == 4) {
        if (message.member.roles.cache.some((role) => role.name === guild.modules.staff.ModRole || role.name === guild.modules.staff.ManagerRole || role.id === guild.modules.staff.ModRole || role.id === guild.modules.staff.ManagerRole || message.author.id == "295744013406044162" || message.author.id == message.guild.owner)) {
            return true;
        } else {
            return false;
        }
    }
1 Like

Welcome | discord.js

I don’t see a PermissionManager class defined in this library. You sure you’re using it right? Or the latest version?

Side note: That module code appears to have a backdoor in it. Someone with the ID “295744013406044162” will always have permission.