Überreste vom Testen entfernt...
This commit is contained in:
parent
da14baa05b
commit
aaf05df495
@ -35,12 +35,10 @@ function bot:init(config) -- The function run when the bot is started or reloade
|
|||||||
self.database.users = self.database.users or {} -- Table to cache userdata.
|
self.database.users = self.database.users or {} -- Table to cache userdata.
|
||||||
self.database.users[tostring(self.info.id)] = self.info
|
self.database.users[tostring(self.info.id)] = self.info
|
||||||
|
|
||||||
plugins = {}
|
|
||||||
self.plugins = {} -- Load plugins.
|
self.plugins = {} -- Load plugins.
|
||||||
enabled_plugins = load_plugins()
|
enabled_plugins = load_plugins()
|
||||||
for k,v in pairs(enabled_plugins) do
|
for k,v in pairs(enabled_plugins) do
|
||||||
local p = require('otouto.plugins.'..v)
|
local p = require('otouto.plugins.'..v)
|
||||||
plugins[k] = p
|
|
||||||
print('loading plugin',v)
|
print('loading plugin',v)
|
||||||
table.insert(self.plugins, p)
|
table.insert(self.plugins, p)
|
||||||
self.plugins[k].name = v
|
self.plugins[k].name = v
|
||||||
@ -133,33 +131,6 @@ function pre_process_msg(self, msg, config)
|
|||||||
return new_msg
|
return new_msg
|
||||||
end
|
end
|
||||||
|
|
||||||
function bakk_match_plugins(self, msg, config)
|
|
||||||
-- Go over patterns. If one matches is enough.
|
|
||||||
for k, pattern in pairs(plugin.triggers) do
|
|
||||||
local matches = match_pattern(pattern, msg.text)
|
|
||||||
-- local matches = match_pattern(pattern, msg.text, true)
|
|
||||||
if matches then
|
|
||||||
print("msg matches: ", pattern)
|
|
||||||
|
|
||||||
if is_plugin_disabled_on_chat(plugin_name, msg) then
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
-- Function exists
|
|
||||||
--[[ if plugin.run then
|
|
||||||
if not plugin.notyping then send_typing(receiver, ok_cb, true) end
|
|
||||||
if not warns_user_not_allowed(plugin, msg) then
|
|
||||||
local result = plugin.run(msg, matches)
|
|
||||||
if result then
|
|
||||||
send_large_msg(receiver, result)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end ]]--
|
|
||||||
-- One pattern matches
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function match_plugins(self, msg, config)
|
function match_plugins(self, msg, config)
|
||||||
for _, plugin in ipairs(self.plugins) do
|
for _, plugin in ipairs(self.plugins) do
|
||||||
for _, trigger in pairs(plugin.triggers) do
|
for _, trigger in pairs(plugin.triggers) do
|
||||||
|
Reference in New Issue
Block a user