bugfixes, redebalo
This commit is contained in:
		
							parent
							
								
									6c0f8b437d
								
							
						
					
					
						commit
						daa848cecd
					
				
					 3 changed files with 10 additions and 7 deletions
				
			
		|  | @ -16,8 +16,9 @@ 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 |     res = res.ValCurs | ||||||
|  |     return 'err' if not res | ||||||
|  | 
 | ||||||
|     table.insert res.Valute, { |     table.insert res.Valute, { | ||||||
|       ID: 'R01000' |       ID: 'R01000' | ||||||
|       NumCode: '001' |       NumCode: '001' | ||||||
|  | @ -58,7 +59,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 == 'error' |     if v == 'err' | ||||||
|       return @api\reply msg, @locale\get 'error', 'req_err', msg.l |       return @api\reply msg, @locale\get 'error', 'req_err', msg.l | ||||||
| 
 | 
 | ||||||
|     nf = {} |     nf = {} | ||||||
|  |  | ||||||
|  | @ -19,10 +19,12 @@ reg = { | ||||||
| (api, msg) => | (api, msg) => | ||||||
|   if msg.text |   if msg.text | ||||||
|     msg.text = utf8.lower ' '.. msg.text ..' ' |     msg.text = utf8.lower ' '.. msg.text ..' ' | ||||||
|     t = '' |     t = msg.text | ||||||
|     for _, v in pairs reg |     for _, v in pairs reg | ||||||
|       if utf8.match msg.text, '%s+'.. v[1] ..'%s+' |       t = utf8.gsub t, '%s+'.. v[1] ..'%s+', ' '.. v[2] ..' ' | ||||||
|         t ..= "#{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 |   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