My implementation of a CommandTree subclass which allows for finding a mention for a given app command.
Just copy the entire third file into a new python file of your project, and import MentionableTree from it.
You can also use git clone [gist link] folder_name
and then from folder_name import MentionableTree