Übernehme einige Änderungen von Brawl345/Brawlbot-v2
This commit is contained in:
34
miku/plugins/botan.lua
Normal file
34
miku/plugins/botan.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
local botan = {}
|
||||
|
||||
local https = require('ssl.https')
|
||||
local URL = require('socket.url')
|
||||
local redis = (loadfile "./miku/redis.lua")()
|
||||
local utilities = require('miku.utilities')
|
||||
local bindings = require('miku.bindings')
|
||||
|
||||
function botan:init(config)
|
||||
if not config.botan_token then
|
||||
print('Fehlender Key: botan_token.')
|
||||
print('botan.lua wird nicht aktiviert.')
|
||||
return
|
||||
end
|
||||
botan.triggers = {
|
||||
"^/nil$"
|
||||
}
|
||||
end
|
||||
|
||||
local BASE_URL = 'https://api.botan.io/track'
|
||||
|
||||
function botan:appmetrica(text, token, plugin_name)
|
||||
https.request(BASE_URL..'/?token='..token..'&uid=1&name='..plugin_name)
|
||||
end
|
||||
|
||||
function botan:action(msg, config, matches, plugin_name)
|
||||
if not plugin_name then
|
||||
return
|
||||
end
|
||||
|
||||
botan:appmetrica(msg.text, config.botan_token, plugin_name)
|
||||
end
|
||||
|
||||
return botan
|
@@ -1,5 +1,4 @@
|
||||
-- This plugin should go at the end of your plugin list in
|
||||
-- config.lua, but not after greetings.lua.
|
||||
-- This plugin should go at the end of your plugin list in config.lua.
|
||||
|
||||
local help = {}
|
||||
|
||||
@@ -8,11 +7,10 @@ local utilities = require('miku.utilities')
|
||||
local help_text
|
||||
|
||||
function help:init(config)
|
||||
help.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('hilfe', true):t('help', true).table
|
||||
help.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('[Hh][Ii][Ll][Ff][Ee]', true):t('[Hh][Ee][Ll][Pp]', true).table
|
||||
end
|
||||
|
||||
function help:action(msg, config)
|
||||
|
||||
local commandlist = {}
|
||||
help_text = '*Verfügbare Befehle:*\n• '..config.cmd_pat
|
||||
|
||||
@@ -20,11 +18,10 @@ function help:action(msg, config)
|
||||
if plugin.command then
|
||||
|
||||
table.insert(commandlist, plugin.command)
|
||||
--help_text = help_text .. '\n• '..config.cmd_pat .. plugin.command:gsub('%[', '\\[')
|
||||
end
|
||||
end
|
||||
|
||||
table.insert(commandlist, 'hilfe [Plugin]')
|
||||
table.insert(commandlist, 'hilfe [Befehl]')
|
||||
table.sort(commandlist)
|
||||
help_text = help_text .. table.concat(commandlist, '\n• '..config.cmd_pat) .. '\nParameter: <benötigt> [optional]'
|
||||
|
||||
@@ -52,7 +49,6 @@ function help:action(msg, config)
|
||||
end
|
||||
|
||||
utilities.send_reply(self, msg, 'Für diesen Befehl gibt es keine Hilfe.')
|
||||
|
||||
end
|
||||
|
||||
return help
|
||||
return help
|
Reference in New Issue
Block a user