-- | User registration, and set a callback to join channels.
connected :: SEvent -> Bot ()
connected Connected = do
    putLogInfo "Connected to server."
    nick <- getGlobal' botNick
    writeMsg $ CMsg NICK [nick]
    writeMsg $ CMsg USER [nick, "0", "*" , nick]
    addCallback respondToEndOfMOTD >>= setGlobal handle376

-- | Remove all the channels from the current channel list.
connected :: SEvent -> Bot ()
connected Connected = do
    putLogInfo "Connected to server."
    nick <- getGlobal' botNick
    writeMsg $ CMsg NICK [nick]
    writeMsg $ CMsg USER [nick, "0", "*" , nick]
    addCallback respondToEndOfMOTD >>= setGlobal handle376

-- | Remove all the channels from the current channel list.
connected Connected = do
    putLogInfo "Connected to server."
    nick <- getGlobal' botNick
    writeMsg $ CMsg NICK [nick]
    writeMsg $ CMsg USER [nick, "0", "*" , nick]
    addCallback respondToEndOfMOTD >>= setGlobal handle376

-- | Remove all the channels from the current channel list.