string.trim(s) is deprecated. Removed some spaces tabulations
This commit is contained in:
parent
dab0c97bb6
commit
9eb136b734
@ -33,11 +33,17 @@ function string:split(sep)
|
|||||||
return fields
|
return fields
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Removes spaces
|
-- DEPRECATED
|
||||||
function string.trim(s)
|
function string.trim(s)
|
||||||
|
print("string.trim(s) is DEPRECATED use string:trim() instead")
|
||||||
return s:gsub("^%s*(.-)%s*$", "%1")
|
return s:gsub("^%s*(.-)%s*$", "%1")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Removes spaces
|
||||||
|
function string:trim()
|
||||||
|
return self:gsub("^%s*(.-)%s*$", "%1")
|
||||||
|
end
|
||||||
|
|
||||||
function get_http_file_name(url, headers)
|
function get_http_file_name(url, headers)
|
||||||
-- Everything after the last /
|
-- Everything after the last /
|
||||||
local file_name = url:match("([^/]+)$")
|
local file_name = url:match("([^/]+)$")
|
||||||
@ -153,24 +159,25 @@ function run_command(str)
|
|||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- User has priviledges
|
||||||
function is_sudo(msg)
|
function is_sudo(msg)
|
||||||
local var = false
|
local var = false
|
||||||
-- Check users id in config
|
-- Check users id in config
|
||||||
for v,user in pairs(_config.sudo_users) do
|
for v,user in pairs(_config.sudo_users) do
|
||||||
if user == msg.from.id then
|
if user == msg.from.id then
|
||||||
var = true
|
var = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return var
|
return var
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns the name of the sender
|
-- Returns the name of the sender
|
||||||
function get_name(msg)
|
function get_name(msg)
|
||||||
local name = msg.from.first_name
|
local name = msg.from.first_name
|
||||||
if name == nil then
|
if name == nil then
|
||||||
name = msg.from.id
|
name = msg.from.id
|
||||||
end
|
end
|
||||||
return name
|
return name
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns at table of lua files inside plugins
|
-- Returns at table of lua files inside plugins
|
||||||
@ -220,7 +227,7 @@ end
|
|||||||
|
|
||||||
-- DEPRECATED!!!!!
|
-- DEPRECATED!!!!!
|
||||||
function string.starts(String, Start)
|
function string.starts(String, Start)
|
||||||
print "string.starts(String, Start) is DEPRECATED use string:starts(text) instead"
|
print("string.starts(String, Start) is DEPRECATED use string:starts(text) instead")
|
||||||
return Start == string.sub(String,1,string.len(Start))
|
return Start == string.sub(String,1,string.len(Start))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user