Explorar o código

Add GBP to rates

Innokenty Enikev %!s(int64=10) %!d(string=hai) anos
pai
achega
017aadaf6b
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      chatikbot.lisp
  2. 1 1
      finance.lisp

+ 1 - 1
chatikbot.lisp

@@ -164,7 +164,7 @@
   (log:info "handle-cmd-rates" chat-id message-id args)
   (let ((rates (get-rates)))
     (telegram-send-message chat-id
-			   (format nil "Зеленый ~A, гейро ~A" (cdar rates) (cdadr rates)))))
+			   (format nil "Зеленый ~A, гейро ~A, британец ~A" (cdar rates) (cdadr rates) (cdaddr rates)))))
 
 (defun handle-cmd-weather (chat-id message-id args)
   (log:info "handle-cmd-weather" chat-id message-id args)

+ 1 - 1
finance.lisp

@@ -3,7 +3,7 @@
 (defparameter +yahoo-url+ "https://query.yahooapis.com/v1/public/yql" "Yahoo Finance API endpoint")
 (defparameter +yahoo-query+ "select Name,Rate from yahoo.finance.xchange where pair in (~{\"~A\"~^,~})")
 
-(defvar *rate-pairs* '("USDRUB" "EURRUB"))
+(defvar *rate-pairs* '("USDRUB" "EURRUB" "GBPRUB"))
 
 (defun get-rates (&optional (pairs *rate-pairs*))
   (let ((response (yason:parse