From 7e26dfa38d724469b71e96682a155175c2e872c2 Mon Sep 17 00:00:00 2001 From: Er2 Date: Wed, 16 Feb 2022 10:49:40 +0300 Subject: [PATCH] add all valutes in rub --- src/cmds/rub.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cmds/rub.lua b/src/cmds/rub.lua index 20e4675..d0a02ec 100644 --- a/src/cmds/rub.lua +++ b/src/cmds/rub.lua @@ -36,6 +36,15 @@ function rub:course(wants) wants = type(wants) == 'table' and wants or {} local r, founds = {}, {} + if table.find(wants, 'HELP') + or table.find(wants, 'ALL') + then + for _, v in pairs(resp.Valute) do + table.insert(r, ('%d %s (%s) = %f Руб.'):format(v.Nominal, v.Name, v.CharCode, v.Value:gsub(',', '.'))) + end + return r, resp.Date, wants + end + for i = 1, #resp.Valute do local v = resp.Valute[i] if table.find(wants, v.CharCode) then