From 7d2a746c2c25b56a90fd09ebfd9ffcec8a6e43c6 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 14 Feb 2020 22:07:58 -0800 Subject: [PATCH] Wait until connected before starting timer --- PBot/PBot.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PBot/PBot.pm b/PBot/PBot.pm index 1ec385e2..fe8000d2 100644 --- a/PBot/PBot.pm +++ b/PBot/PBot.pm @@ -237,9 +237,6 @@ sub initialize { # load available plugins $self->{plugins}->autoload(%conf); - # start timer - $self->{timer}->start(); - # give botowner all capabilities $self->{capabilities}->rebuild_botowner_capabilities(); } @@ -282,7 +279,10 @@ sub connect { $self->{connected} = 1; - #set up handlers for the IRC engine + # start timer once connected + $self->{timer}->start; + + # set up handlers for the IRC engine $self->{conn}->add_default_handler(sub { $self->{irchandlers}->default_handler(@_) }, 1); $self->{conn}->add_handler([ 251,252,253,254,255,302 ], sub { $self->{irchandlers}->on_init(@_) });