anchor.diff:  (defun msgstr-irc->tg (msg)
     (concatenate 'string (msg-user msg) ": " (msg-body msg)))
   
  -(defun send-irc-message (str)
  -  (privmsg *irc-connection* *irc-channel*
  +(defun send-irc-message (bot str)
  +  (privmsg (bot-irc-connection bot)
  +           (bot-irc-channel bot)
              (correct-cljson-surrogate-pairs str)))
   
  -(defvar *irc-message-pool-head* (list :head))
  -(defvar *irc-message-pool-tail* *irc-message-pool-head*)
  -(defvar *irc-message-pool-lock*
  -  (sb-thread:make-mutex
  -   :name "irc message pool lock"))
  -
  -(defun push-msg-pool (str)
  -  (sb-thread:with-mutex (*irc-message-pool-lock*)
  +(defun init-bot-irc-msg-pool (bot)
  +  (setf (bot-irc-message-pool-head bot) (list :head))
  +  (setf (bot-irc-message-pool-tail bot)
  +        (bot-irc-message-pool-head bot))
  +  (setf (bot-irc-message-pool-lock bot)
  +        (sb-thread:make-mutex
  +         :name "bot-irc-message-pool-lock")))
  +
  +(defun push-msg-pool (str bot)
  +  (sb-thread:with-mutex ((bot-irc-message-pool-lock bot))
       (let ((new (list str)))
  -      (setf (cdr *irc-message-pool-tail*) new)
  -      (setf *irc-message-pool-tail* new))))
  -
  -(defun irc-message-hook (msg)
  -  (if (string= *irc-channel*
  -               (msg-channel msg))
  -      (funcall *tg-message-sender*
  -               (msgstr-irc->tg msg))
  -      nil))
  +      (setf (cdr (bot-irc-message-pool-tail bot)) new)
  +      (setf (bot-irc-message-pool-tail bot) new))))
   
   ;; supress warning
   (defun bot-halt ())
  -(defun send-tg-message (str) str)
  -(defun irc-check-connection ())
  -(defun irc-reconnect (&optional (callback nil))
  -  (tryto (remove-all-hooks *irc-connection*))
  -  (tryto (quit *irc-connection*))
  -  (tryto (sb-thread:terminate-thread *irc-read-loop*))
  +(defun send-tg-message (bot str) bot str)
  +(defun irc-check-connection (bot) bot)
  +(defun irc-reconnect (bot &optional (callback nil))
  +  (tryto (remove-all-hooks (bot-irc-connection bot)))
  +  (tryto (quit (bot-irc-connection bot)))
  +  (tryto (sb-thread:terminate-thread
  +          (bot-thread-irc-read-loop bot)))
     (sleep 5)
     (logging "Connecting to IRC")
  -  (setf *irc-connection*
  +  (setf (bot-irc-connection bot)
           (connect :nickname "MidyMidyTGBot"
                    :server "irc.freenode.net"))
     (logging "JOIN CHANNEL")
  -  (join *irc-connection* *irc-channel*)
  +  (join (bot-irc-connection bot) (bot-irc-channel bot))
     (logging "ADD HOOKS")
  -  (add-hook *irc-connection*
  +  (add-hook (bot-irc-connection bot)
               'irc::irc-privmsg-message
  -            #'irc-message-hook)
  -  (add-hook *irc-connection*
  +            (lambda (msg)
  +              (if (string= (bot-irc-channel bot)
  +                           (msg-channel msg))
  +                  (send-tg-message bot
  +                                   (msgstr-irc->tg msg)))))
  +  (add-hook (bot-irc-connection bot)
               'irc::irc-pong-message
               (lambda (msg)
                 (declare (ignore msg))
                 (sb-thread:signal-semaphore
  -               *ping-semaphore*)))
  +               (bot-irc-ping-semaphore bot))))
     (logging "ACTIVATE IRC-READ-LOOP")
  -  (setf *irc-read-loop*
  +  (setf (bot-thread-irc-read-loop bot)
           (sb-thread:make-thread
            (lambda ()
  -           (read-message-loop *irc-connection*))
  +           (read-message-loop (bot-irc-connection bot)))
            :name "IRC-READ-LOOP"))
  -  ;;(start-background-message-handler *irc-connection*)
     (if callback
         (funcall callback)))
   
  -(defun clear-msg-pool-f ()
  -  (if (cdr *irc-message-pool-head*)
  +(defun clear-msg-pool-f (bot)
  +  (if (cdr (bot-irc-message-pool-head bot))
         (handler-case
             (progn
               (send-irc-message
  -             (cadr *irc-message-pool-head*))
  -            (setf (cdr *irc-message-pool-head*)
  -                  (cddr *irc-message-pool-head*))
  -            (clear-msg-pool-f))
  +             bot
  +             (cadr (bot-irc-message-pool-head bot)))
  +            (setf (cdr (bot-irc-message-pool-head bot))
  +                  (cddr (bot-irc-message-pool-head bot)))
  +            (clear-msg-pool-f bot))
           (condition ()
  -          (logging "clear-msg-pool-f: Cannot send message!")))))
  -
  -(defun irc-shutdown ()
  +          (logging "clear-msg-pool-f: Can NOT send irc msg, give up!")))))
  +
  +(defun irc-shutdown (bot)
     (tryto
  -   (part *irc-connection* *irc-channel* "Bot shutdown"))
  -  (tryto (quit *irc-connection* "leaving"))
  -  (tryto (sb-thread:terminate-thread *irc-read-loop*)))
  -
  -(defun irc-check-connection ()
  +   (part (bot-irc-connection bot)
  +         (bot-irc-channel bot) "Bot shutdown"))
  +  (tryto (quit (bot-irc-connection bot) "leaving"))
  +  (tryto (sb-thread:terminate-thread (bot-thread-irc-read-loop bot))))
  +
  +(defun irc-check-connection (bot)
     (let ((t1 (get-internal-real-time)))
  -    (tryto (ping *irc-connection* *irc-channel*))
  +    (tryto (ping (bot-irc-connection bot) (bot-irc-channel bot)))
       (if (sb-thread:wait-on-semaphore
  -         *ping-semaphore* :timeout 20)
  +         (bot-irc-ping-semaphore bot) :timeout 20)
           (let ((time-elapse
                  (float (/ (- (get-internal-real-time) t1)
                            internal-time-units-per-second))))
  -          (setf *ping-semaphore*
  +          (setf (bot-irc-ping-semaphore bot)
                   (sb-thread:make-semaphore))
             time-elapse)
  -        (progn (setf *ping-semaphore*
  +        (progn (setf (bot-irc-ping-semaphore bot)
                        (sb-thread:make-semaphore))
                  nil))))
   
   ;;;; -----------------------------------------
   
  -(defun tg-request (method-name &optional parameters)
  +(defun tg-request (method-name bot &optional parameters)
     (let ((http-method (if parameters :post :get)))
       (flexi-streams:octets-to-string
        (http-request
         (concatenate 'string
                      "https://api.telegram.org/"
  -                   *tg-auth-str* "/"
  +                   (bot-tg-bot-authstr bot) "/"
                      method-name)
         :connection-timeout 100
         :method http-method
  
positive.code:       "[ image > 600KB ]"
        (let* ((img-vector
                (tg-download-file
                 (tg-get-file-path
                  (jget :file--id
                        (jget :document
                              (jget :message update))))))
  
negative.code: 
  (defparameter *tg-loop* nil)
  (defparameter *irc-watcher* nil)
  
  (defun creat-watcher-f (bot)
    (logging "Create IRC watcher")
    (setf (bot-thread-irc-watcher bot)
          (sb-thread:make-thread
           (lambda ()
             (loop
                (sleep 60)
                (logging "Checking IRC Connection ...")
                (let ((delay (irc-check-connection bot)))
                  (if delay
                      (progn
                        (logging "OK! Ping delay: ~As" delay)
                        (logging "Trying to clear Msg Pool")
                        (clear-msg-pool-f bot)
                        (setf (bot-irc-reconnect-counter bot) 0))
                      (progn
                        (logging "FAILED! RECONNECTING!")
                        (incf (bot-irc-reconnect-counter bot))
                        (if (> 20 (bot-irc-reconnect-counter bot))
                            (handler-case
                                (progn (irc-reconnect bot)
                                       (clear-msg-pool-f bot))
                              (condition (e)
                                (logging "Having Trouble: ~S" e)))
                            (progn (logging "Give up, Bot halt!")
  