The initial sync is not needed, provided that the user has to supply anyway the room ID or alias in the command line of the script.
This adds two similar examples, one using matrix.client, and the other using matrix.api.