Discord.js: fn.bind() is not a function

Created on 23 May 2018  Â·  6Comments  Â·  Source: discordjs/discord.js

Please describe the problem you are having in as much detail as possible:
So, after npm installing discordjs/discord.js, on using guilds.find(), it throws a TypeError: fn.bind is not a function.

(additional log output)
at Map.find (\sora-5\node_modules\discord.js\src\util\Collection.js:171:49)

(could be related to dependencies)

Include a reproducible code sample here, if possible:

this.client.guilds.find('name', 'guildName');

Further details:

  • discord.js version: 12.0.0-dev
  • node.js version: 8.11.1 (also tested on 10.1.0)
  • Operating system: Windows 10 x64
  • Priority this issue should have – please be realistic and elaborate if possible: low-med

  • [ ] I found this issue while running code on a __user account__

  • [ ] I have also tested the issue on latest master, commit hash:
question (please use Discord instead)

Most helpful comment

If you look at the documentation, you'll see that this format is not supported in the development version of discord.js https://discord.js.org/#/docs/main/master/class/Collection?scrollTo=find

All 6 comments

If you look at the documentation, you'll see that this format is not supported in the development version of discord.js https://discord.js.org/#/docs/main/master/class/Collection?scrollTo=find

Instead, use

this.client.guilds.find(guild => guild.name === 'guildName');

ty! :)

@appellation May I ask why that format is no longer supported?

@FireController1847 There was a PR with its discussion here.
To sum it up (as the description of the PR notes), it was due to the method not adding any new functionality, since the same can be accomplished with the callback parameter. It is a similar case for the other methods and parameters that were revoked.

var roless = message.guild.roles.cache.find('name', role);

whats problem? i used var role =

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Blumlaut picture Blumlaut  Â·  3Comments

kvn1351 picture kvn1351  Â·  3Comments

Alipoodle picture Alipoodle  Â·  3Comments

ghost picture ghost  Â·  3Comments

BrandonCookeDev picture BrandonCookeDev  Â·  3Comments