Reputation: 22914
How can I detect if a message is from a user who is chatting with my bot in a private channel (DM with only the bot) using the Event API?
Upvotes: 2
Views: 998
Reputation: 1102
Check the first letter in the channel id. If it starts with D
it is a DM channel. If it starts with C
it is a public channel.
For example, D2AH456
is a DM channel, whereas C234F56
is a public #channel
Upvotes: 7