How to read messages from chat using tmi?

Than you for the quick reply. I fully understand the limitations on whispering. And I do not intend my bot to initiate any private conversations on twitch. What I can do is, to read whispered commands. What I need is, to reply to them with new whispers.

An an “External portal” is easily convertable to Twitch Extension anyway.

I’m not sure it will solve my problem, as I already have an “external portal” to which users are supposed to be granted access by the bot. That’s why it’s passing secret messages.

A link to any documentation on how such an extension is made would be nice. I am no expert on twitch, which I’ve never used before. I do have some programming skills, though.