This repository has been archived on 2021-04-24. You can view files and clone it, but cannot push or open issues or pull requests.
Mikubot-2/miku/plugins/botan.lua

34 lines
775 B
Lua

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