Giter Club home page Giter Club logo

Comments (10)

amishshah avatar amishshah commented on August 23, 2024

Thanks for posting this, I think I can fix it but I will have to do it tomorrow.

Thanks

from discord.js.

amishshah avatar amishshah commented on August 23, 2024

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.

enebe-nb avatar enebe-nb commented on August 23, 2024

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.

amishshah avatar amishshah commented on August 23, 2024

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.

enebe-nb avatar enebe-nb commented on August 23, 2024

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.

macharborguy avatar macharborguy commented on August 23, 2024

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.

enebe-nb avatar enebe-nb commented on August 23, 2024

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.

amishshah avatar amishshah commented on August 23, 2024

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.

amishshah avatar amishshah commented on August 23, 2024

Whoops didn't mean to close haha

from discord.js.

amishshah avatar amishshah commented on August 23, 2024

The fix has now been pushed to npm (version 3.8.3)

from discord.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.