Just check what the latest message was, you don't need the chatbox api.
m.getMessage() i think it would be, or something similar.
What you are doing is checking the entire chatbox every time someone sends a message, which of course it contains the same thing that was said before.
Also, String#contains is case sensetive, so this would only work if it was a capital H, you should change it to
m.getMessage().toLowerCase().contains("hi")