Method to check if message is a command or not