get_txt.lua: KürzeText, wenn länger als 500 Zeichen
This commit is contained in:
parent
85e220c5b9
commit
0b62c7d947
@ -15,7 +15,12 @@ function get_txt:action(msg, config, matches)
|
|||||||
utilities.send_reply(msg, config.errors.connection)
|
utilities.send_reply(msg, config.errors.connection)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
utilities.send_reply(msg, res)
|
if string.len(res) > 500 then
|
||||||
|
result = string.sub(res:gsub("%b<>", ""), 1, 500)..'...\n(Text gekürzt, da länger als 500 Zeichen.)'
|
||||||
|
else
|
||||||
|
result = res
|
||||||
|
end
|
||||||
|
utilities.send_reply(msg, result)
|
||||||
end
|
end
|
||||||
|
|
||||||
return get_txt
|
return get_txt
|
@ -329,20 +329,20 @@ function rss:cron()
|
|||||||
local link = v2.link or v2.id or 'Kein Link'
|
local link = v2.link or v2.id or 'Kein Link'
|
||||||
if v2.content then
|
if v2.content then
|
||||||
content = v2.content:gsub("%b<>", "")
|
content = v2.content:gsub("%b<>", "")
|
||||||
if string.len(v2.content) > 300 then
|
if string.len(v2.content) > 250 then
|
||||||
content = cleanRSS(content)
|
content = cleanRSS(content)
|
||||||
content = unescape(content)
|
content = unescape(content)
|
||||||
content = string.sub(content, 1, 300)..'...'
|
content = string.sub(content, 1, 250)..'...'
|
||||||
else
|
else
|
||||||
content = cleanRSS(content)
|
content = cleanRSS(content)
|
||||||
content = unescape(content)
|
content = unescape(content)
|
||||||
end
|
end
|
||||||
elseif v2.summary then
|
elseif v2.summary then
|
||||||
content = v2.summary:gsub("%b<>", "")
|
content = v2.summary:gsub("%b<>", "")
|
||||||
if string.len(v2.summary) > 300 then
|
if string.len(v2.summary) > 250 then
|
||||||
content = cleanRSS(content)
|
content = cleanRSS(content)
|
||||||
content = unescape(content)
|
content = unescape(content)
|
||||||
content = string.sub(content, 1, 300)..'...'
|
content = string.sub(content, 1, 250)..'...'
|
||||||
else
|
else
|
||||||
content = cleanRSS(content)
|
content = cleanRSS(content)
|
||||||
content = unescape(content)
|
content = unescape(content)
|
||||||
|
Reference in New Issue
Block a user