Compare commits
No commits in common. "0b2a7ac8e515e232a0076b854de33892dae92eb8" and "6c0f8b437d80d1fa6d9bd83619a44980cb535a89" have entirely different histories.
0b2a7ac8e5
...
6c0f8b437d
4 changed files with 8 additions and 23 deletions
2
etc/api
2
etc/api
|
|
@ -1 +1 @@
|
||||||
Subproject commit da0a266b72f0919c5ed1bfa3fbc75e7d2f398229
|
Subproject commit fefafd4923e824cb5a7f762c7e65d24cdc1f8d87
|
||||||
|
|
@ -16,9 +16,8 @@ rub =
|
||||||
res, suc = @tools._req @url, 'GET'
|
res, suc = @tools._req @url, 'GET'
|
||||||
return 'err' if not suc
|
return 'err' if not suc
|
||||||
res = @tools.json.decode res or '{}'
|
res = @tools.json.decode res or '{}'
|
||||||
res = res.ValCurs
|
|
||||||
return 'err' if not res
|
|
||||||
|
|
||||||
|
res = res.ValCurs
|
||||||
table.insert res.Valute, {
|
table.insert res.Valute, {
|
||||||
ID: 'R01000'
|
ID: 'R01000'
|
||||||
NumCode: '001'
|
NumCode: '001'
|
||||||
|
|
@ -59,7 +58,7 @@ rub =
|
||||||
wants[i] = wants[i]\upper!
|
wants[i] = wants[i]\upper!
|
||||||
|
|
||||||
v, d, f = rub\course wants
|
v, d, f = rub\course wants
|
||||||
if v == 'err'
|
if v == 'error'
|
||||||
return @api\reply msg, @locale\get 'error', 'req_err', msg.l
|
return @api\reply msg, @locale\get 'error', 'req_err', msg.l
|
||||||
|
|
||||||
nf = {}
|
nf = {}
|
||||||
|
|
|
||||||
|
|
@ -16,27 +16,13 @@ reg = {
|
||||||
{'чё%?*', 'ничё'}
|
{'чё%?*', 'ничё'}
|
||||||
}
|
}
|
||||||
|
|
||||||
stick = {
|
|
||||||
{
|
|
||||||
'AgADwAADcpO1DQ'
|
|
||||||
'редебало'
|
|
||||||
'CAACAgIAAx0CUY2umQACFItiHHUg6w_MPu6Vs8k76cwn4OIHNQACwAADcpO1DVbNTDlmHOWMIwQ'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(api, msg) =>
|
(api, msg) =>
|
||||||
if msg.text
|
if msg.text
|
||||||
msg.text = utf8.lower ' '.. msg.text ..' '
|
msg.text = utf8.lower ' '.. msg.text ..' '
|
||||||
t = msg.text
|
t = ''
|
||||||
for _, v in pairs reg
|
for _, v in pairs reg
|
||||||
t = utf8.gsub t, '%s+'.. v[1] ..'%s+', ' '.. v[2] ..' '
|
if utf8.match msg.text, '%s+'.. v[1] ..'%s+'
|
||||||
|
t ..= "#{v[2]} "
|
||||||
api\reply msg, t if t ~= msg.text
|
|
||||||
elseif msg.sticker
|
|
||||||
for k, v in pairs stick
|
|
||||||
if msg.sticker.file_unique_id == v[1]
|
|
||||||
if math.random! <= 0.5
|
|
||||||
api\reply msg, v[2]
|
|
||||||
else api\sendSticker msg, v[3] --, _, _, _, msg.message_id
|
|
||||||
|
|
||||||
|
api\reply msg, t if t ~= ''
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ export dump = (t, d) ->
|
||||||
elseif type(v) == 'userdata'
|
elseif type(v) == 'userdata'
|
||||||
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
|
c
|
||||||
|
|
||||||
(api) =>
|
(api) =>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue