What kind of bots are you building out of curiosity?
If you’re not building on top of Hubot, I’d recommend taking the same approach as I did with the Hubot adapter, and listen with the message bus for notifications.
You can get a pretty good idea of how to use the Discourse API for getting messages, and responding by looking at the adapter source, too.