Kaynağa Gözat

[transmission] fix empty torrents response

Innocenty Enikeev 8 yıl önce
ebeveyn
işleme
8516c3ff12
1 değiştirilmiş dosya ile 4 ekleme ve 3 silme
  1. 4 3
      plugins/transmission.lisp

+ 4 - 3
plugins/transmission.lisp

@@ -80,9 +80,10 @@
 (def-message-cmd-handler handle-torrents (:torrents)
   (let ((url (aget chat-id *transmission-settings*)))
     (if url
-        (bot-send-message chat-id
-                          (format nil "~{~A~^~%~}" (mapcar #'%format-torrent
-                                                           (transmission-get-torrents url))))
+        (let ((torrents (transmission-get-torrents url)))
+          (bot-send-message chat-id
+                            (if torrents (format nil "~{~A~^~%~}" (mapcar #'%format-torrent torrents))
+                                "Пустой список!")))
         (bot-send-message chat-id "Бота настрой!"))))
 
 (defun %torrent-add-and-respond (chat-id &key filename metainfo)