izy521 / discord.io

A small, single-file library for creating DiscordApp clients from Node.js or the browser
https://discord.gg/0MvHMfHcTKVVmIGP
MIT License
535 stars 154 forks source link

Identify message type #253

Open marco-kretz opened 6 years ago

marco-kretz commented 6 years ago

Hey,

I just can't find a way to identify a message type. Every message I receive, either in a pulbic channel or via DM, has a type of "0". Does anyone got a tipp here for me?

cloudrac3r commented 6 years ago

What were you expecting message type to return?

Message type describes the type of message that was sent. 0 is a regular message, that is typed by a human. Anything other than 0 is a special message, and you can see a reference of these at https://discordapp.com/developers/docs/resources/channel#message-object-message-types. These special messages are actually not really messages at all but announcements of events such as a person joining or leaving, a call being started or a message being pinned.

When I pin a message, my bot receives a message of type 6, so I believe all types are correctly recognised by discord.io.

If you still have questions, please give me some more information: what did you expect to happen, and what actually happened, and how are you getting the message type in your code?

blackfatpig commented 5 years ago

Please help me, how I can detect the message that sent from a channel or from a user (Direct Messaging) in our bot with discord.io? Many thanks!

elliottpalermo commented 5 years ago

@blackfatpig Did you figure this out? I'm also trying to detect if a message is a DM or not... not sure if it's possible?