Compare commits
	
		
			No commits in common. "7e26dfa38d724469b71e96682a155175c2e872c2" and "8f538ba65a60cd437819ccbb907f461115948c01" have entirely different histories.
		
	
	
		
			7e26dfa38d
			...
			8f538ba65a
		
	
		
					 3 changed files with 2 additions and 17 deletions
				
			
		|  | @ -39,13 +39,11 @@ return { | ||||||
|       api = owner and C.api or nil, |       api = owner and C.api or nil, | ||||||
|     } |     } | ||||||
|     for k,v in pairs(env) do t[k] = v end |     for k,v in pairs(env) do t[k] = v end | ||||||
|     local e, err = load(C.api.unparseArgs(msg.args), 'eval', 'bt', t) |     local e, err = load(C.api.unparseArgs(msg.args), 'eval', 't', t) | ||||||
|     xpcall(function() |     xpcall(function() | ||||||
|       if err then error(err) end |       if err then error(err) end | ||||||
|       e = tostring(e() or '...') |       e = tostring(e() or '...') | ||||||
|     end, function(err) e = err end) |     end, function(err) e = err end) | ||||||
|     s = s ..'\n'.. e |     C.api:send(msg, s .. '\n' .. e) | ||||||
|     s = s:gsub(C.api.token:escp(), '<TOKEN>') |  | ||||||
|     C.api:reply(msg, s) |  | ||||||
|   end |   end | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -36,15 +36,6 @@ function rub:course(wants) | ||||||
|   wants = type(wants) == 'table' and wants or {} |   wants = type(wants) == 'table' and wants or {} | ||||||
|   local r, founds = {}, {} |   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 |   for i = 1, #resp.Valute do | ||||||
|     local v = resp.Valute[i] |     local v = resp.Valute[i] | ||||||
|     if table.find(wants, v.CharCode) then |     if table.find(wants, v.CharCode) then | ||||||
|  |  | ||||||
|  | @ -21,10 +21,6 @@ function table.findV(t, w) | ||||||
|   end |   end | ||||||
| end | end | ||||||
| 
 | 
 | ||||||
| function string.escp(s) |  | ||||||
|   return s:gsub('[%^%$%%%(%)%.%[%]%*%+%-%?]', '%%%0') |  | ||||||
| end |  | ||||||
| 
 |  | ||||||
| function dump(t, d) | function dump(t, d) | ||||||
|   if not tonumber(d) or d < 0 then d = 0 end |   if not tonumber(d) or d < 0 then d = 0 end | ||||||
|   local c = '' |   local c = '' | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue