I am trying to send message in OpenedServiceListener, but i think it's too early, the bot hasn't even signed on. Is there an event that lets me know when the bot has finished initializing? Then i could put my code somewhere else.
THanks for your help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It works when I wait a few seconds before sending the message - gives the bot time to init. However, if convo.sendMessage() doesn't work (because its too early), is there any way I can tell? convo.canSendMessage() returns true in all cases.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The solution is to wait for all services to be ready. I believe there's an event allServicesReady in openedserviceslistener, or something like that. You could also wait for the connection state to be ONLINE.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry to barge in on this thread... I'm trying to do basically the same thing as Mr Nobody: just connect, send an IM, and disconnect. Thanks to your tip, I have a loop that tests for State.ONLINE, then calls conversation.sendMessage(). I don't get an error or anything, but I also don't seem to be successfully sending the IM. What do you suggested checking for next?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think it's strange that it doesn't send. I suggest tracing the call through a debugger to figure out why it isn't sent. I'd liek to know the results.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i'm building a bot that updates me with rss, but i can only make the bot reply to my IMs. Is there a way to make the bot send IMs actively?
btw, this is what i am doing:
ImConversation convo = icbmService.getImConversation(new Screenname("asdf"));
convo.sendMessage(new BasicInstantMessage("hello"));
what does happen: the Conversation Listener gets the SentMessage event, but I never actually receive a message on AIM.
i think i know what the error is.
I am trying to send message in OpenedServiceListener, but i think it's too early, the bot hasn't even signed on. Is there an event that lets me know when the bot has finished initializing? Then i could put my code somewhere else.
THanks for your help!
It works when I wait a few seconds before sending the message - gives the bot time to init. However, if convo.sendMessage() doesn't work (because its too early), is there any way I can tell? convo.canSendMessage() returns true in all cases.
The solution is to wait for all services to be ready. I believe there's an event allServicesReady in openedserviceslistener, or something like that. You could also wait for the connection state to be ONLINE.
Sorry to barge in on this thread... I'm trying to do basically the same thing as Mr Nobody: just connect, send an IM, and disconnect. Thanks to your tip, I have a loop that tests for State.ONLINE, then calls conversation.sendMessage(). I don't get an error or anything, but I also don't seem to be successfully sending the IM. What do you suggested checking for next?
I think it's strange that it doesn't send. I suggest tracing the call through a debugger to figure out why it isn't sent. I'd liek to know the results.