Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

member.displayColor and member.displayHexColor doesn't works #6249

Closed
RobotoSkunk opened this issue Jul 31, 2021 · 2 comments · Fixed by #6245
Closed

member.displayColor and member.displayHexColor doesn't works #6249

RobotoSkunk opened this issue Jul 31, 2021 · 2 comments · Fixed by #6245

Comments

@RobotoSkunk
Copy link

RobotoSkunk commented Jul 31, 2021

Please describe the problem you are having in as much detail as possible:

I updated the library from v12 to v13-dev to check the new features and I find a bug with the member colors.
First the console returned me TypeError: member.roles.cache.array is not a function so I thought that in this version, the function member.roles.cache.array was deprecated, then I replaced it. After that, the console returned me TypeError: sorted.array is not a function and when I commented the lines with member.displayHexColor and member.displayColor it disappears.

The bug is caused by the file .\src\structures\Role.js in the line 162 because the function array() doesn't exists.

return sorted.array().indexOf(sorted.get(this.id));

Sample code:

const client = new Discord.Client({
	"intents": [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES]
});
client.once('ready', () => {
	console.log('Bot ready and running!');
	client.user.setPresence({
		"activity":{
			"type":"STREAMING",
			"url":"https://www.youtube.com/watch?v=MobkO51msMI",
			"name":`d!help | robotoskunk.com`
		}
	});
});

client.on('messageCreate', async message => {
	try {
		if (message.content == "color-bug-test") {
			return await message.channel.send(message.member.displayHexColor);
			return await message.channel.send(message.member.displayColor);
		}
	} catch(err) {
		console.log(err);
	}
});

client.login('token goes here').catch((err) => {
	console.log(err);
	process.exit(-1);
});

Further details:

  • discord.js version: 13.0.0-dev.t1627689836.ee3cdc8
  • Node.js version: 14.17.4
  • Operating system: Windows 10
  • Priority this issue should have: as the array() function was removed from the Role class, it may be that other functions have been affected.

Relevant client options:

  • partials: none
  • gateway intents: GUILDS, GUILD_MESSAGES
  • other: none
@Jiralite
Copy link
Member

Will be resolved with #6245!

@kyranet kyranet linked a pull request Jul 31, 2021 that will close this issue
@RobotoSkunk
Copy link
Author

Will be resolved with #6245!

Woah, that commit fixed my issue!! Thank you!!!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants