Sende keine Fehlermeldungen mehr an den Chat, sondern ignoriere die Nachricht einfach. Es wird empfohlen, einen Log-Chat einzurichten und die Fehlermeldungen dort hinleiten zu lassen (siehe config.lua.example)
This commit is contained in:
parent
b9dbaa3244
commit
55a56e1a6f
@ -222,14 +222,6 @@ function match_plugins(self, msg, config, plugin)
|
|||||||
return plugin.action(self, msg, config, matches)
|
return plugin.action(self, msg, config, matches)
|
||||||
end)
|
end)
|
||||||
if not success then
|
if not success then
|
||||||
-- If the plugin has an error message, send it. If it does
|
|
||||||
-- not, use the generic one specified in config. If it's set
|
|
||||||
-- to false, do nothing.
|
|
||||||
if plugin.error then
|
|
||||||
utilities.send_reply(self, msg, plugin.error)
|
|
||||||
elseif plugin.error == nil then
|
|
||||||
utilities.send_reply(self, msg, config.errors.generic, true)
|
|
||||||
end
|
|
||||||
utilities.handle_exception(self, result, msg.from.id .. ': ' .. msg.text, config)
|
utilities.handle_exception(self, result, msg.from.id .. ': ' .. msg.text, config)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -485,18 +485,14 @@ function utilities:user_from_message(msg, no_extra)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function utilities:handle_exception(err, message, config)
|
function utilities:handle_exception(err, message, config)
|
||||||
|
|
||||||
if not err then err = '' end
|
if not err then err = '' end
|
||||||
|
|
||||||
local output = '\n[' .. os.date('%F %T', os.time()) .. ']\n' .. self.info.username .. ': ' .. err .. '\n' .. message .. '\n'
|
local output = '\n[' .. os.date('%F %T', os.time()) .. ']\n' .. self.info.username .. ': ' .. err .. '\n' .. message .. '\n'
|
||||||
|
|
||||||
if config.log_chat then
|
if config.log_chat then
|
||||||
output = '```' .. output .. '```'
|
output = '```' .. output .. '```'
|
||||||
utilities.send_message(self, config.log_chat, output, true, nil, true)
|
utilities.send_message(self, config.log_chat, output, true, nil, true)
|
||||||
else
|
else
|
||||||
print(output)
|
print(output)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- MOVED TO DOWNLOAD_TO_FILE
|
-- MOVED TO DOWNLOAD_TO_FILE
|
||||||
|
Reference in New Issue
Block a user