How to detect when player is in dialogue?

I am coding a different menu for my game, which activates when pressing escape, but I realized, that you could open the menu when in dialogue. How do I detect when I'm talking to someone? The default menu somehow accomplishes this, but I couldn't find the code for it.
$gameMessage.isBusy() will return true if a text box is active
That worked! Thank you.
$gameMessage.isBusy() will return true if a text box is active

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-detect-when-player-is-in-dialogue.116387/