Does that help There are no API methods that will directly return a response from a bot. To capture responses of bots (and users) you need to read the messages from a channel. With the Web API you can do that by calling channels.history for public channels (or groups.history private channels and similar names methods for other conversation types. you can also use the new conversations.history method to access all types of channels).
To fix the issue you can do Using the RTM API to build a bot will work, but there is indeed an easier way: Use the new Event API from Slack. The Event API allows you to subscribe to range of events. When the event happens, Slack will automatically call your php script. So you don't need to run a CRON loop. This also works with bot users and direct messages to bot users.
How can a Slack bot detect a direct message vs a message in a channel?
will help you I talked to James at Slack and he gave me a simply way to determine if a message is a DM or not; if a channel ID begins with a: C, it's a public channel D, it's a DM with the user G, it's either a private channel or multi-person DM
I hope this helps . I am trying to implement a Bot which can get all the Direct Message Channels, all the workspace Users and send Direct Messages to them. If I work with my development workspace everything works as expected but when I try with my company workspace, my Bot is only capable to retrieve the Direct Message Channel it is belonging to. Any idea on how to fix by production Bot. , to Slack support I got my answer:
Slack API - Sending a direct message to personal space (you)