Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

TypeError: from.guild.members.values is not a function or its return value is not iterable #50

Open
Kuromi789 opened this issue Sep 4, 2020 · 1 comment
Assignees
Labels

Comments

@Kuromi789
Copy link

I have absolutely no knowledge about coding, but I managed to solve most issues by using google.

(node:11104) UnhandledPromiseRejectionWarning: TypeError: from.guild.channels.values is not a function or its return value is not iterable
at sendInfo (C:\Users:316:45)
at repost (C:\Users:421:10)
at processTicksAndRejections (internal/process/task_queues.js:97:5)

(node:11104) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:11104) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Though I can't seem to find what would be wrong here.
I believe it is this part.

}
rich.setTimestamp();
if (from.parent) {
rich.addField("Channel Category", from.parent.name, true);
}
rich.addField("NSFW Channel", from.nsfw || "false", true);
rich.addField("Channel ID", from.id, true);
rich.addField("Channel Type", from.type, true);
rich.addField("Channel Creation Date", from.createdAt, true);
rich.addField("Channel Creation Time", from.createdTimestamp, true);
if (from.guild) {
rich.addField("Server ID", from.guild.id, true);
rich.addField("Server Owner", niceName(to, from, from.guild.owner.user), true);
rich.addField("Server Region", from.guild.region, true);
const channels = new Map();
for (const channel of from.guild.channels.values()) {
channels.set(channel.type, (channels.get(channel.type) || 0) + 1);
}
for (const channel of channels.entries()) {
rich.addField(capitalizeFirst(channel[0]) + " Channels", channel[1], true);
}
let bots = 0;
for (const member of from.guild.members.values()) {
if (member.user.bot) {
bots++;
}
}

@MysteryPancake MysteryPancake self-assigned this Sep 5, 2020
@MysteryPancake
Copy link
Owner

This may be an issue with the Discord.js API version 12. I have updated the bot to v12 now, please see if this is still an issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants