Comments (10)
Thanks for posting this, I think I can fix it but I will have to do it tomorrow.
Thanks
from discord.js.
Issue is now fixed! See 3578178. Thanks for bringing it to my attention, you can get the fix by either cloning the repo or just running npm update. It's been released as a bug fix in 3.8.2.
from discord.js.
Still unresolved, the message.isPrivate
is never set, so this.channel.server.getMember()
is still being called, causing the same error.
I can make a better debug in private messages once i get some free time.
from discord.js.
Are you sure? It's fully working here, and isPrivate should be set. Can you state which OS and node version you're running on.
from discord.js.
On Client.js:923
when receiving CHANNEL_CREATE message, it must check if data.is_private == true
and call self.addPMChannel
instead self.addChannel
in this case.
probably you was using same user for tests then the chanel was already created.
from discord.js.
same thing happened with me just now. the first private message i sent our bot crashed it out. All messages after were fine. Asked one of our mods to send a PM, this was the first from her, and it crashed the bot, all others after were fine.
So yes, it appears that the first, initial PM to the bot from each user will crash it, as its not processing the PM channel creation properly. After the channel is created (per user), everything is fine. I am using the latest version of Discord.js
./node_modules/discord.js/lib/message.js:27
this.author = this.channel.server.getMember("id", author.id) || this.channel.client.getUser("id", author.id);
^
TypeError: Cannot read property 'getMember' of null
at new Message (./node_modules/discord.js/lib/message.js:27:37)
at WebSocket.websocket.onmessage (./node_modules/discord.js/lib/Client.js:876:37)
at WebSocket.onMessage (./node_modules/discord.js/node_modules/ws/lib/WebSocket.js:414:14)
at emitTwo (events.js:87:13)
at WebSocket.emit (events.js:172:7)
at Receiver.ontext (./node_modules/discord.js/node_modules/ws/lib/WebSocket.js:797:10)
at ./node_modules/discord.js/node_modules/ws/lib/Receiver.js:473:18
at Receiver.applyExtensions (./node_modules/discord.js/node_modules/ws/lib/Receiver.js:360:5)
at ./node_modules/discord.js/node_modules/ws/lib/Receiver.js:462:14
at Receiver.flush (./node_modules/discord.js/node_modules/ws/lib/Receiver.js:336:3)
from discord.js.
I don't know if hydrabolt published the lasts commits on npm. Can you try to install the lib directly from git?
npm remove discord.js
npm install https://github.com/hydrabolt/discord.js/tarball/master
from discord.js.
I've not yet been able to push enebe-nb's fixes to npm, I will be able to do so within a few hours
from discord.js.
Whoops didn't mean to close haha
from discord.js.
The fix has now been pushed to npm (version 3.8.3)
from discord.js.
Related Issues (20)
- TypeError in GuildDeleteAction.handle when Destroying Voice Adapter HOT 13
- Bot send embed messages twice or even triple times after being not used for a while HOT 15
- Raw audio stream with AudioPlayer HOT 2
- [SlashCommandStringOptions] Be able to pass arguments to the constructor, or more builder options for SlashCommandStringOption HOT 2
- Publish a new release (dev build points to /ws that doesn't include a fix) HOT 3
- ClientPresenceStatusData Canary and PTB HOT 1
- ActionRowBuilder Constructor improperly merging provided components into new componentbuilders HOT 4
- Client is not receiving 'messageCreate' events HOT 1
- .toJSON() is 'unknown' HOT 1
- crashing after message deletion HOT 5
- Using channel.send on a channel where the bot has not the permission to post makes the whole program crash HOT 3
- Kicking the bot from its dev guild and inviting it again drops the slash commands HOT 6
- Automated Message nonce handling HOT 1
- Emit poll events on uncached messages
- `ws` throws `TypeError: Cannot use 'in' operator to search for 'code' in undefined` when with Deno HOT 6
- Wrong base URL for GIF stickers
- [Typing] `interaction.followUp()` should not have `ephemeral` in its options? HOT 6
- oops HOT 1
- Uncaught exception when adding member that is already part of the guild
- Readonly arrays in interfaces don't allow dynamically adding data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discord.js.