bugfixes, redebalo

This commit is contained in:
Er2 2022-02-27 23:29:37 +03:00
parent 6c0f8b437d
commit daa848cecd
3 changed files with 10 additions and 7 deletions

View File

@ -16,8 +16,9 @@ rub =
res, suc = @tools._req @url, 'GET'
return 'err' if not suc
res = @tools.json.decode res or '{}'
res = res.ValCurs
return 'err' if not res
table.insert res.Valute, {
ID: 'R01000'
NumCode: '001'
@ -58,7 +59,7 @@ rub =
wants[i] = wants[i]\upper!
v, d, f = rub\course wants
if v == 'error'
if v == 'err'
return @api\reply msg, @locale\get 'error', 'req_err', msg.l
nf = {}

View File

@ -19,10 +19,12 @@ reg = {
(api, msg) =>
if msg.text
msg.text = utf8.lower ' '.. msg.text ..' '
t = ''
t = msg.text
for _, v in pairs reg
if utf8.match msg.text, '%s+'.. v[1] ..'%s+'
t ..= "#{v[2]} "
t = utf8.gsub t, '%s+'.. v[1] ..'%s+', ' '.. v[2] ..' '
api\reply msg, t if t ~= ''
api\reply msg, t if t ~= msg.text
elseif msg.sticker
if msg.sticker.file_unique_id == 'AgADwAADcpO1DQ'
api\reply msg, 'редебало'
return

View File

@ -32,7 +32,7 @@ export dump = (t, d) ->
elseif type(v) == 'userdata'
v = '<USERDATA>'
c ..= ('%s%s = %s\n')\format (' ')\rep d, k, v
c ..= ('%s%s = %s\n')\format (' ')\rep(d), k, v
c
(api) =>