Please describe the problem you are having in as much detail as possible:
I'm really wondering how it is possible that this wasn't caught by anyone and I was really rejecting the idea of creating an issue because of this...
I have basically picked up the code you had on your main page and used it to just print out the author's username. The problem is that, after I get the first message from some channel with the correct author, all other messages from the same channel will feature the same author. The message itself contains the correct information, though.
Include a reproducible code sample here, if possible:
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log('I am ready!');
});
client.on('message', (message) => {
console.log('author', message.author.username);
});
client.login("my token");
Further details:
Priority this issue should have – please be realistic and elaborate if possible: I'd say High. But I'm still a little bit confused about this not working at the moment.
[ ] I found this issue while running code on a __user account__
I was looking at discord.js' package.json, it seems to require node v8.0.0 or above. It actually works when using version v8.0.0, so it's probably an issue with node v6.x.x, perhaps?
If the intention is to support only above node v8.0.0, then I guess this is a non-issue.
That's because you are looking at the master branch which is the development version.
@iCrawl You're right. The version I have installed states "node": ">=6.0.0". I'm not sure why I'm getting the issue on versions 6.10.0 and 6.11.4 though. Did you run that test on these versions @dragonfire535?
Actually, I just saw this happen with version 8.0.0 as well. Really weird, since it was working properly before and there were no significant changes to the code :
davb
Sent from Outlookhttp://aka.ms/weboutlook
From: Tiago Matos notifications@github.com
Sent: Saturday, 21 October 2017 8:50 AM
To: hydrabolt/discord.js
Cc: Subscribed
Subject: Re: [hydrabolt/discord.js] Messages from the same channel retain the author from the first message caught (#2045)
@iCrawlhttps://github.com/icrawl You're right. The version I have installed states "node": ">=6.0.0". I'm not sure why I'm getting the issue on versions 6.10.0 and 6.11.4 though. Did you run that test on these versions @dragonfire535https://github.com/dragonfire535?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com/hydrabolt/discord.js/issues/2045#issuecomment-338352417, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVB7wDxxIBvwriwYravNTKerGDMcMeLVks5suT_kgaJpZM4QBVQ8.
Extra data:
Ok, I figured it out. The situation is far more specific than I was thinking.
So this is a single bot that changes name, so the ID of the bot is the same, but the name is different. Since discord.js "caches" the users here:
https://github.com/hydrabolt/discord.js/blob/11.2.0/src/client/ClientDataManager.js#L42
It will always fetch the initial name and not the current one.
This isn't probably much to ask for, but can you install master via npm i hydrabolt/discord.js and test this case again? It should be resolved there iirc.
Please make sure the entries in the package.json and package-lock.json update when you update.
@iCrawl Yes, it's fixed on the master, though it currently locks you to v8.0.0