Closed frostgit-dev closed 4 years ago
The issue is: Cannot read property 'ROLES' of null
What is that big blob of code?
Please respond back with your code by using a code block & answer the question as mentioned by @yogurtsyum
Code blocks can be sent by wrapping your message with ```, this is just like the same system as Discord currently has. For further information on GitHub formatting, please check out the official guide here..
Ensure you also provide correct photo links, it seems that I cannot access the photo you have sent, thank you.
Fixed nvm.
const roblox = require('noblox.js'); const chalk = require('chalk'); require('dotenv').config();
async function getRankName(func_group, func_user){ let rolename = await roblox.getRankNameInGroup(func_group, func_user); return rolename; }
async function getRankID(func_group, func_user){ let role = await roblox.getRankInGroup(func_group, func_user); return role; }
async function getRankFromName(func_rankname, func_group){ let roles = await roblox.getRoles(func_group); let role = await roles.find(rank => rank.name == func_rankname); if(!role){ return 'NOT_FOUND'; } return role.rank; }
exports.run = async (client, message, args) => { if(!message.member.roles.cache.some(role =>["[-] Bot", "Solea Owners", "Ron"].includes(role.name))){ return message.channel.send({embed: { color: 16733013, title: 'Access Denied!', description: "You need to have permissions from ven#2175 to run this command, he said only bots can.", author: { name: message.author.tag, icon_url: message.author.displayAvatarURL() } }}) }
Who used the command: <@${message.author.id}> \n Target User: ${username} \n Old Rank: ${rankNameInGroup} (${rankInGroup}) \n New Rank: ${setRankResponse.name} (${setRankResponse.rank}).
, footer: { text: 'Solea Ranking', icon_url:
https://cdn.discordapp.com/attachments/746770154821517394/747027560860352582/1e73e4fc65899dadf0e0db20dfe68dc2.png}, timestamp: new Date(), thumbnail: { url:
http://www.roblox.com/Thumbs/Avatar.ashx?x=150&y=150&format=png&username=${username}` } }}); }