Added administration.lua.
Adds self-hosted, single-realm administrative functions to otouto. Check out the README for a detailed description. Also added msg.from.name, which is msg.from.first_name + msg.from.last_name (if it exists), because I'm too lazy to build it each time. Fixed a crash-causing bug (ironically) in the handle_exception() function.
This commit is contained in:
1008
plugins/administration.lua
Normal file
1008
plugins/administration.lua
Normal file
File diff suppressed because it is too large
Load Diff
@@ -63,7 +63,7 @@ local action = function(msg)
|
||||
end
|
||||
|
||||
text = text:gsub('</?.->', '')
|
||||
local l = text:find('\n')
|
||||
local l = text:find('<h2>')
|
||||
if l then
|
||||
text = text:sub(1, l-1)
|
||||
end
|
||||
@@ -78,15 +78,15 @@ local action = function(msg)
|
||||
output = output .. '[Read more.](' .. url .. ')'
|
||||
end
|
||||
|
||||
sendMessage(msg.chat.id, output, true, nil, true)
|
||||
--
|
||||
--[[ Comment the previous block and uncomment this one for full-message,
|
||||
-- "unlinked" link previews.
|
||||
-- Invisible zero-width, non-joiner.
|
||||
local output = '[](' .. jdat.responseData.results[1].url .. ')'
|
||||
sendMessage(msg.chat.id, output, false, nil, true)
|
||||
]]--
|
||||
|
||||
sendMessage(msg.chat.id, output, true, nil, true)
|
||||
|
||||
end
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user