Git Product home page Git Product logo

Comments (8)

Jiralite avatar Jiralite commented on September 24, 2024 1

Now I get you, thank you! I would be glad if we make it more clear about hasThread in its description.

Sure, we can welcome improvements and clarity. That would be a pull request we would be interested in.

from discord.js.

FreePhoenix888 avatar FreePhoenix888 commented on September 24, 2024

Sorry I was unable to make my pr draft

from discord.js.

Jiralite avatar Jiralite commented on September 24, 2024

Why would a new message immediately have a thread?

from discord.js.

monbrey avatar monbrey commented on September 24, 2024

I'm pretty sure this property checks if the message is the starter message for a thread, not just if it's a reply to one.

from discord.js.

FreePhoenix888 avatar FreePhoenix888 commented on September 24, 2024

Why would a new message immediately have a thread?

Why would not? I have created a thread and write my messages there, why should not they have a thread?

from discord.js.

FreePhoenix888 avatar FreePhoenix888 commented on September 24, 2024

I'm pretty sure this property checks if the message is the starter message for a thread, not just if it's a reply to one.

No, check thread's documentation: The thread started by this message This property is not suitable for checking whether a message has a thread, use [hasThread](https://discord.js.org/docs/packages/discord.js/14.14.1/Message:Class#hasThread) instead.

from discord.js.

Jiralite avatar Jiralite commented on September 24, 2024

Why would not? I have created a thread and write my messages there, why should not they have a thread?

A created message sent over the gateway will not have a thread created from it. Those happen afterwards.

I have created a thread and write my messages there

Those messages don't have a thread. They are in a thread. If you want to check if a message is sent within a thread, check the channel type it's sent in.

No, check thread's documentation: The thread started by this message This property is not suitable for checking whether a message has a thread, use [hasThread](https://discord.js.org/docs/packages/discord.js/14.14.1/Message:Class#hasThread) instead.

This reply makes it clear that this is a misunderstanding of what you are reading. Dumbing it down:

  • Message#hasThread checks if the message has a thread, as in, there is a thread created off the message.
  • Message#thread is the thread created off the message.

from discord.js.

FreePhoenix888 avatar FreePhoenix888 commented on September 24, 2024

Why would not? I have created a thread and write my messages there, why should not they have a thread?

A created message sent over the gateway will not have a thread created from it. Those happen afterwards.

I have created a thread and write my messages there

Those messages don't have a thread. They are in a thread. If you want to check if a message is sent within a thread, check the channel type it's sent in.

No, check thread's documentation: The thread started by this message This property is not suitable for checking whether a message has a thread, use [hasThread](https://discord.js.org/docs/packages/discord.js/14.14.1/Message:Class#hasThread) instead.

This reply makes it clear that this is a misunderstanding of what you are reading. Dumbing it down:

  • Message#hasThread checks if the message has a thread, as in, there is a thread created off the message.
  • Message#thread is the thread created off the message.

Now I get you, thank you! I would be glad if we make it more clear about hasThread in its description

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.