I've developed a bot that sends periodically messages to users ; but I want to send messages only if users are online. Is there a way to test that? (for the moment I just use the SendMessage method with the user accounts of my users)

btw it seems I can send messages to anyone, even people who didn't subscribe to the bot, is it normal?

subscribe to the OnPresence handler to see who of your contacts is online. Then you can add a logic to your client which is sending the messages only to online users. To get the presence of a user it must be on your contact list and subscribed of course.