#DiscordWhitelist exports

1 messages · Page 1 of 1 (latest)

hollow sky
#

Hey cuties, a simple one for yas. i dont understand what to do to just check for a role with the bot? like... What would i do?

Local hasrole = exports[hasrole] or something? im lost 😦

hollow sky
#

exports('getRoles', (src) => {
    if(!work) return;
    return new Promise((res, rej) => {
        getUserDiscord(src, function(userId) {
            if(userId) {
                console.log("TRUE,DISCORD ID FOUND")
                axios(`/guilds/${guildId}/members/${userId}`).then((resDis) => {
                    if(!resDis.data) {
                        console.log("FALSE NO ROLES?")
                        res([])
                    }
                    console.log("TRUE,HAS ROLES?")
                    res(resDis.data.roles)
                }).catch((err) => {
                    console.log("FALSEERROR")
                    res([])
                });
            } else {
                console.log("FALSE,NO DISCORD ID")
                res([])
            }
        });
    });
});
#

This is what im calling