Jonis Hjellestad
unread,Mar 8, 2013, 4:10:34 AM3/8/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pirc...@googlegroups.com
Fairly new to programming, and events is kind of new to me, so I'm unsure of the approach.
MessageEvent was easy enough to understand, but trying to figure out the correct way to approach a reconnect.
So far I've done this:
public void onDisconnect(DisconnectEvent event) throws Exception {
int i = 0;
while (!event.getBot().isConnected() && i < 20) {
Thread.sleep(2500);
event.getBot().reconnect();
i++;
}
}
But I'm not sure if I need to use DisconnectedEvent or ReconnectEvent.
Any help would be greatly appreciated.