- Restrukturierung: "require" wird nun nicht mehr in jedem Plugin benötigt

- Echo: Korrekte Ausgabe in Supergruppen
This commit is contained in:
Andreas Bielawski 2016-07-31 21:29:44 +02:00
parent 01bdfab0aa
commit 2118a844d9
126 changed files with 80 additions and 619 deletions

View File

@ -1,17 +1,11 @@
local bot = {} local bot = {}
-- Requires are moved to init to allow for reloads. bindings = require('otouto.bindings')
local bindings -- Load Telegram bindings. utilities = require('otouto.utilities')
local utilities -- Load miscellaneous and cross-plugin functions.
local redis = (loadfile "./otouto/redis.lua")()
bot.version = '2.2.3.2' bot.version = '2.2.3.2'
function bot:init(config) -- The function run when the bot is started or reloaded. function bot:init(config) -- The function run when the bot is started or reloaded.
bindings = require('otouto.bindings')
utilities = require('otouto.utilities')
redis = (loadfile "./otouto/redis.lua")()
cred_data = load_cred() cred_data = load_cred()
assert( assert(

View File

@ -1,11 +1,5 @@
local ninegag = {} local ninegag = {}
local HTTP = require('socket.http')
local URL = require('socket.url')
local JSON = require('dkjson')
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
ninegag.command = '9gag' ninegag.command = '9gag'
function ninegag:init(config) function ninegag:init(config)
@ -20,9 +14,9 @@ end
local url = "http://api-9gag.herokuapp.com/" local url = "http://api-9gag.herokuapp.com/"
function ninegag:get_9GAG() function ninegag:get_9GAG()
local b,c = HTTP.request(url) local b,c = http.request(url)
if c ~= 200 then return nil end if c ~= 200 then return nil end
local gag = JSON.decode(b) local gag = json.decode(b)
-- random max json table size -- random max json table size
local i = math.random(#gag) local i = math.random(#gag)
@ -33,9 +27,9 @@ function ninegag:get_9GAG()
end end
function ninegag:inline_callback(inline_query, config) function ninegag:inline_callback(inline_query, config)
local res, code = HTTP.request(url) local res, code = http.request(url)
if code ~= 200 then return end if code ~= 200 then return end
local gag = JSON.decode(res) local gag = json.decode(res)
local results = '[' local results = '['
for n in pairs(gag) do for n in pairs(gag) do

View File

@ -1,7 +1,6 @@
local about = {} local about = {}
local bot = require('otouto.bot') local bot = require('otouto.bot')
local utilities = require('otouto.utilities')
about.command = 'about' about.command = 'about'
about.doc = '`Sendet Informationen über den Bot.`' about.doc = '`Sendet Informationen über den Bot.`'

View File

@ -1,9 +1,5 @@
local adfly = {} local adfly = {}
local utilities = require('otouto.utilities')
local HTTPS = require('ssl.https')
local redis = (loadfile "./otouto/redis.lua")()
function adfly:init(config) function adfly:init(config)
adfly.triggers = { adfly.triggers = {
'adf.ly/([A-Za-z0-9-_-]+)' 'adf.ly/([A-Za-z0-9-_-]+)'
@ -15,7 +11,7 @@ end
function adfly:expand_adfly_link(adfly_code) function adfly:expand_adfly_link(adfly_code)
local BASE_URL = 'https://andibi.tk/dl/adfly.php' local BASE_URL = 'https://andibi.tk/dl/adfly.php'
local url = BASE_URL..'/?url=http://adf.ly/'..adfly_code local url = BASE_URL..'/?url=http://adf.ly/'..adfly_code
local res,code = HTTPS.request(url) local res,code = https.request(url)
if code ~= 200 then return nil end if code ~= 200 then return nil end
if res == 'Fehler: Keine Adf.ly-URL gefunden!' then return 'NOTFOUND' end if res == 'Fehler: Keine Adf.ly-URL gefunden!' then return 'NOTFOUND' end
cache_data('adfly', adfly_code, res, 31536000, 'key') cache_data('adfly', adfly_code, res, 31536000, 'key')

View File

@ -3,9 +3,6 @@
local afk = {} local afk = {}
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
function afk:init(config) function afk:init(config)
afk.triggers = { afk.triggers = {
"^/([A|a][F|f][K|k])$", "^/([A|a][F|f][K|k])$",

View File

@ -1,10 +1,5 @@
local app_store = {} local app_store = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
app_store.triggers = { app_store.triggers = {
"itunes.apple.com/(.*)/app/(.*)/id(%d+)", "itunes.apple.com/(.*)/app/(.*)/id(%d+)",
"^/itunes (%d+)$", "^/itunes (%d+)$",

View File

@ -1,13 +1,5 @@
local bImages = {} local bImages = {}
local HTTPS = require('ssl.https')
HTTPS.timeout = 10
local URL = require('socket.url')
local JSON = require('dkjson')
local redis = (loadfile "./otouto/redis.lua")()
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
function bImages:init(config) function bImages:init(config)
if not cred_data.bing_search_key then if not cred_data.bing_search_key then
print('Missing config value: bing_search_key.') print('Missing config value: bing_search_key.')
@ -36,9 +28,9 @@ function bImages:getImages(query)
["Ocp-Apim-Subscription-Key"] = apikey ["Ocp-Apim-Subscription-Key"] = apikey
} }
} }
local ok, response_code, response_headers = HTTPS.request(request_constructor) local ok, response_code, response_headers = https.request(request_constructor)
if not ok then return end if not ok then return end
local images = JSON.decode(table.concat(response_body)).value local images = json.decode(table.concat(response_body)).value
if not images[1] then return end if not images[1] then return end

View File

@ -1,9 +1,5 @@
local banhammer = {} local banhammer = {}
local bindings = require('otouto.bindings')
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
banhammer.command = 'banhammer <nur für Superuser>' banhammer.command = 'banhammer <nur für Superuser>'
function banhammer:init(config) function banhammer:init(config)

View File

@ -1,10 +1,5 @@
local bitly = {} local bitly = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
function bitly:init(config) function bitly:init(config)
if not cred_data.bitly_access_token then if not cred_data.bitly_access_token then
print('Missing config value: bitly_access_token.') print('Missing config value: bitly_access_token.')

View File

@ -1,14 +1,5 @@
local bitly_create = {} local bitly_create = {}
local http = require('socket.http')
local https = require('ssl.https')
local URL = require('socket.url')
local json = require('dkjson')
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
local OAuth = require "OAuth"
local redis = (loadfile "./otouto/redis.lua")()
function bitly_create:init(config) function bitly_create:init(config)
if not cred_data.bitly_client_id then if not cred_data.bitly_client_id then
print('Missing config value: bitly_client_id.') print('Missing config value: bitly_client_id.')

View File

@ -1,11 +1,5 @@
local br = {} local br = {}
local https = require('ssl.https')
local URL = require('socket.url')
local json = require('dkjson')
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
br.triggers = { br.triggers = {
"br.de/nachrichten/(.*).html$" "br.de/nachrichten/(.*).html$"
} }

View File

@ -1,11 +1,5 @@
local btc = {} local btc = {}
local https = require('ssl.https')
local URL = require('socket.url')
local json = require('dkjson')
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
function btc:init(config) function btc:init(config)
btc.triggers = { btc.triggers = {
"^/btc$" "^/btc$"

View File

@ -1,9 +1,5 @@
local calc = {} local calc = {}
local URL = require('socket.url')
local http = require('socket.http')
local utilities = require('otouto.utilities')
calc.command = 'calc <Ausdruck>' calc.command = 'calc <Ausdruck>'
function calc:init(config) function calc:init(config)

View File

@ -1,9 +1,5 @@
local cats = {} local cats = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
cats.command = 'cat [gif]' cats.command = 'cat [gif]'
function cats:init(config) function cats:init(config)

View File

@ -1,8 +1,5 @@
local channel = {} local channel = {}
local bindings = require('otouto.bindings')
local utilities = require('otouto.utilities')
channel.command = 'ch <Kanal> \\n <Nachricht>' channel.command = 'ch <Kanal> \\n <Nachricht>'
channel.doc = [[* channel.doc = [[*
/ch*_ <Kanal>_|_[Inline-Keyboard]_ /ch*_ <Kanal>_|_[Inline-Keyboard]_

View File

@ -1,9 +1,5 @@
local channels = {} local channels = {}
local bindings = require('otouto.bindings')
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
channels.command = 'channel <nur für Superuser>' channels.command = 'channel <nur für Superuser>'
function channels:init(config) function channels:init(config)

View File

@ -1,10 +1,5 @@
local cleverbot = {} local cleverbot = {}
local https = require('ssl.https')
local URL = require('socket.url')
local utilities = require('otouto.utilities')
local json = require('dkjson')
function cleverbot:init(config) function cleverbot:init(config)
cleverbot.triggers = { cleverbot.triggers = {
"^/cbot (.*)$" "^/cbot (.*)$"

View File

@ -1,10 +1,5 @@
local clypit = {} local clypit = {}
local http = require('socket.http')
local json = require('dkjson')
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
clypit.triggers = { clypit.triggers = {
"clyp.it/([A-Za-z0-9-_-]+)" "clyp.it/([A-Za-z0-9-_-]+)"
} }

View File

@ -1,8 +1,6 @@
local control = {} local control = {}
local bot = require('otouto.bot') local bot = require('otouto.bot')
local utilities = require('otouto.utilities')
local cmd_pat -- Prevents the command from being uncallable. local cmd_pat -- Prevents the command from being uncallable.
function control:init(config) function control:init(config)

View File

@ -1,8 +1,5 @@
local creds_manager = {} local creds_manager = {}
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
function creds_manager:init(config) function creds_manager:init(config)
creds_manager.triggers = { creds_manager.triggers = {
"^(/creds)$", "^(/creds)$",

View File

@ -1,8 +1,5 @@
local currency = {} local currency = {}
local HTTPS = require('ssl.https')
local utilities = require('otouto.utilities')
currency.command = 'cash [Menge] <von> <zu>' currency.command = 'cash [Menge] <von> <zu>'
function currency:init(config) function currency:init(config)
@ -42,7 +39,7 @@ function currency:action(msg, config)
end end
local url = BASE_URL..'?from='..from..'&to='..to..'&a='..amount local url = BASE_URL..'?from='..from..'&to='..to..'&a='..amount
local str, res = HTTPS.request(url) local str, res = https.request(url)
if res ~= 200 then if res ~= 200 then
utilities.send_reply(self, msg, config.errors.connection) utilities.send_reply(self, msg, config.errors.connection)
return return

View File

@ -1,9 +1,5 @@
local dailymotion = {} local dailymotion = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
dailymotion.triggers = { dailymotion.triggers = {
"dailymotion.com/video/([A-Za-z0-9-_-]+)" "dailymotion.com/video/([A-Za-z0-9-_-]+)"
} }

View File

@ -1,9 +1,5 @@
local deviantart = {} local deviantart = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
deviantart.triggers = { deviantart.triggers = {
"http://(.*).deviantart.com/art/(.*)" "http://(.*).deviantart.com/art/(.*)"
} }

View File

@ -1,9 +1,5 @@
local dhl = {} local dhl = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
function dhl:init(config) function dhl:init(config)
dhl.triggers = { dhl.triggers = {
"/dhl (%d+)$" "/dhl (%d+)$"

View File

@ -2,10 +2,6 @@
local dropbox = {} local dropbox = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
dropbox.triggers = { dropbox.triggers = {
"dropbox.com/s/([a-z0-9]+)/(.*)" "dropbox.com/s/([a-z0-9]+)/(.*)"
} }

View File

@ -1,7 +1,5 @@
local echo = {} local echo = {}
local utilities = require('otouto.utilities')
echo.command = 'echo <Text>' echo.command = 'echo <Text>'
function echo:init(config) function echo:init(config)
@ -35,6 +33,8 @@ function echo:action(msg)
local output local output
if msg.chat.type == 'supergroup' then if msg.chat.type == 'supergroup' then
output = '*Echo:*\n"' .. utilities.md_escape(input) .. '"' output = '*Echo:*\n"' .. utilities.md_escape(input) .. '"'
utilities.send_message(self, msg.chat.id, output, true, nil, true)
return
end end
utilities.send_message(self, msg.chat.id, input, true, nil, true) utilities.send_message(self, msg.chat.id, input, true, nil, true)
end end

View File

@ -1,8 +1,5 @@
local entergroup = {} local entergroup = {}
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
entergroup.triggers = { entergroup.triggers = {
'/nil' '/nil'
} }

View File

@ -1,8 +1,5 @@
local expand = {} local expand = {}
local http = require('socket.http')
local utilities = require('otouto.utilities')
function expand:init(config) function expand:init(config)
expand.triggers = { expand.triggers = {
"^/expand (https?://[%w-_%.%?%.:/%+=&]+)$" "^/expand (https?://[%w-_%.%?%.:/%+=&]+)$"

View File

@ -1,13 +1,5 @@
local facebook = {} local facebook = {}
local http = require('socket.http')
local https = require('ssl.https')
local URL = require('socket.url')
local json = require('dkjson')
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
local redis = (loadfile "./otouto/redis.lua")()
function facebook:init(config) function facebook:init(config)
if not cred_data.fb_access_token then if not cred_data.fb_access_token then
print('Missing config value: fb_access_token.') print('Missing config value: fb_access_token.')

View File

@ -1,9 +1,5 @@
local fefe = {} local fefe = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
fefe.triggers = { fefe.triggers = {
"blog.fefe.de/%?ts=%w%w%w%w%w%w%w%w" "blog.fefe.de/%?ts=%w%w%w%w%w%w%w%w"
} }

View File

@ -1,10 +1,5 @@
local flickr = {} local flickr = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
function flickr:init(config) function flickr:init(config)
if not cred_data.flickr_apikey then if not cred_data.flickr_apikey then
print('Missing config value: flickr_apikey.') print('Missing config value: flickr_apikey.')

View File

@ -1,10 +1,5 @@
local flickr_search = {} local flickr_search = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
function flickr_search:init(config) function flickr_search:init(config)
if not cred_data.flickr_apikey then if not cred_data.flickr_apikey then
print('Missing config value: flickr_apikey.') print('Missing config value: flickr_apikey.')

View File

@ -1,12 +1,5 @@
local forecast = {} local forecast = {}
local HTTPS = require('ssl.https')
local URL = require('socket.url')
local JSON = require('dkjson')
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
local redis = (loadfile "./otouto/redis.lua")()
function forecast:init(config) function forecast:init(config)
if not cred_data.forecastio_apikey then if not cred_data.forecastio_apikey then
print('Missing config value: forecastio_apikey.') print('Missing config value: forecastio_apikey.')
@ -46,9 +39,9 @@ function get_city_name(lat, lng)
local city = redis:hget('telegram:cache:weather:pretty_names', lat..','..lng) local city = redis:hget('telegram:cache:weather:pretty_names', lat..','..lng)
if city then return city end if city then return city end
local url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng='..lat..','..lng..'&result_type=political&language=de&key='..google_apikey local url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng='..lat..','..lng..'&result_type=political&language=de&key='..google_apikey
local res, code = HTTPS.request(url) local res, code = https.request(url)
if code ~= 200 then return 'Unbekannte Stadt' end if code ~= 200 then return 'Unbekannte Stadt' end
local data = JSON.decode(res).results[1] local data = json.decode(res).results[1]
local city = data.formatted_address local city = data.formatted_address
print('Setting '..lat..','..lng..' in redis hash telegram:cache:weather:pretty_names to "'..city..'"') print('Setting '..lat..','..lng..' in redis hash telegram:cache:weather:pretty_names to "'..city..'"')
redis:hset('telegram:cache:weather:pretty_names', lat..','..lng, city) redis:hset('telegram:cache:weather:pretty_names', lat..','..lng, city)
@ -107,9 +100,9 @@ function forecast:get_forecast(lat, lng)
method = "GET", method = "GET",
sink = ltn12.sink.table(response_body) sink = ltn12.sink.table(response_body)
} }
local ok, response_code, response_headers, response_status_line = HTTPS.request(request_constructor) local ok, response_code, response_headers, response_status_line = https.request(request_constructor)
if not ok then return nil end if not ok then return nil end
local data = JSON.decode(table.concat(response_body)) local data = json.decode(table.concat(response_body))
local ttl = string.sub(response_headers["cache-control"], 9) local ttl = string.sub(response_headers["cache-control"], 9)
@ -153,9 +146,9 @@ function forecast:get_forecast_hourly(lat, lng)
method = "GET", method = "GET",
sink = ltn12.sink.table(response_body) sink = ltn12.sink.table(response_body)
} }
local ok, response_code, response_headers, response_status_line = HTTPS.request(request_constructor) local ok, response_code, response_headers, response_status_line = https.request(request_constructor)
if not ok then return nil end if not ok then return nil end
local data = JSON.decode(table.concat(response_body)) local data = json.decode(table.concat(response_body))
local ttl = string.sub(response_headers["cache-control"], 9) local ttl = string.sub(response_headers["cache-control"], 9)

View File

@ -3,14 +3,6 @@
local gImages = {} local gImages = {}
local HTTPS = require('ssl.https')
HTTPS.timeout = 10
local URL = require('socket.url')
local JSON = require('dkjson')
local redis = (loadfile "./otouto/redis.lua")()
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
function gImages:init(config) function gImages:init(config)
if not cred_data.google_apikey then if not cred_data.google_apikey then
print('Missing config value: google_apikey.') print('Missing config value: google_apikey.')
@ -115,8 +107,8 @@ function gImages:get_image(input)
local cseid = cred_data.google_cse_id local cseid = cred_data.google_cse_id
local BASE_URL = 'https://www.googleapis.com/customsearch/v1' local BASE_URL = 'https://www.googleapis.com/customsearch/v1'
local url = BASE_URL..'/?searchType=image&alt=json&num=10&key='..apikey..'&cx='..cseid..'&safe=high'..'&q=' .. input .. '&fields=items(link,mime,image(contextLink))' local url = BASE_URL..'/?searchType=image&alt=json&num=10&key='..apikey..'&cx='..cseid..'&safe=high'..'&q=' .. input .. '&fields=items(link,mime,image(contextLink))'
local jstr, res = HTTPS.request(url) local jstr, res = https.request(url)
local jdat = JSON.decode(jstr).items local jdat = json.decode(jstr).items
if not jdat then if not jdat then
return 'NORESULTS' return 'NORESULTS'

View File

@ -1,8 +1,5 @@
local gMaps = {} local gMaps = {}
local URL = require('socket.url')
local utilities = require('otouto.utilities')
gMaps.command = 'loc <Ort>' gMaps.command = 'loc <Ort>'
function gMaps:init(config) function gMaps:init(config)

View File

@ -1,10 +1,5 @@
local gSearch = {} local gSearch = {}
local HTTPS = require('ssl.https')
local URL = require('socket.url')
local JSON = require('dkjson')
local utilities = require('otouto.utilities')
gSearch.command = 'google <Suchbegriff>' gSearch.command = 'google <Suchbegriff>'
function gSearch:init(config) function gSearch:init(config)
@ -23,7 +18,7 @@ function gSearch:googlethat(query, config)
local api = BASE_URL.."/?key="..apikey.."&cx="..cseid.."&gl=de&num="..number.."&safe=medium&fields=searchInformation%28formattedSearchTime,formattedTotalResults%29,items%28title,link,displayLink%29&" local api = BASE_URL.."/?key="..apikey.."&cx="..cseid.."&gl=de&num="..number.."&safe=medium&fields=searchInformation%28formattedSearchTime,formattedTotalResults%29,items%28title,link,displayLink%29&"
local parameters = "q=".. (URL.escape(query) or "") local parameters = "q=".. (URL.escape(query) or "")
-- Do the request -- Do the request
local res, code = HTTPS.request(api..parameters) local res, code = https.request(api..parameters)
if code == 403 then if code == 403 then
return '403' return '403'
end end

View File

@ -1,10 +1,6 @@
local games = {} local games = {}
local http = require('socket.http')
local URL = require('socket.url')
local xml = require("xml") local xml = require("xml")
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
games.command = 'game <Spiel>' games.command = 'game <Spiel>'

View File

@ -1,11 +1,5 @@
local gdrive = {} local gdrive = {}
local utilities = require('otouto.utilities')
local https = require('ssl.https')
local ltn12 = require('ltn12')
local json = require('dkjson')
local bindings = require('otouto.bindings')
function gdrive:init(config) function gdrive:init(config)
if not cred_data.google_apikey then if not cred_data.google_apikey then
print('Missing config value: google_apikey.') print('Missing config value: google_apikey.')

View File

@ -1,8 +1,5 @@
local get = {} local get = {}
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
get.command = 'get <Variable>' get.command = 'get <Variable>'
function get:init(config) function get:init(config)

View File

@ -4,12 +4,6 @@
local media_download = {} local media_download = {}
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
local ltn12 = require('ltn12')
local HTTPS = require('ssl.https')
local redis = (loadfile "./otouto/redis.lua")()
media_download.triggers = { media_download.triggers = {
'/nil' '/nil'
} }
@ -22,7 +16,7 @@ function media_download:download_to_file_permanently(url, file_name)
redirect = false redirect = false
} }
local response = nil local response = nil
response = {HTTPS.request(options)} response = {https.request(options)}
local code = response[2] local code = response[2]
local headers = response[3] local headers = response[3]

View File

@ -2,10 +2,6 @@
local gfycat = {} local gfycat = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
gfycat.triggers = { gfycat.triggers = {
"gfycat.com/([A-Za-z0-9-_-]+)" "gfycat.com/([A-Za-z0-9-_-]+)"
} }

View File

@ -1,10 +1,5 @@
local giphy = {} local giphy = {}
local http = require('socket.http')
local URL = require('socket.url')
local JSON = require('dkjson')
local utilities = require('otouto.utilities')
function giphy:init(config) function giphy:init(config)
giphy.triggers = { giphy.triggers = {
"/nil" "/nil"
@ -26,7 +21,7 @@ function giphy:get_gifs(query)
end end
local res, code = http.request(url) local res, code = http.request(url)
if code ~= 200 then return nil end if code ~= 200 then return nil end
return JSON.decode(res).data return json.decode(res).data
end end
function giphy:inline_callback(inline_query, config, matches) function giphy:inline_callback(inline_query, config, matches)

View File

@ -1,13 +1,5 @@
local github = {} local github = {}
local http = require('socket.http')
local https = require('ssl.https')
local URL = require('socket.url')
local json = require('dkjson')
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
local redis = (loadfile "./otouto/redis.lua")()
function github:init(config) function github:init(config)
github.triggers = { github.triggers = {
"github.com/([A-Za-z0-9-_-.-._.]+)/([A-Za-z0-9-_-.-._.]+)/commit/([a-z0-9-]+)", "github.com/([A-Za-z0-9-_-.-._.]+)/([A-Za-z0-9-_-.-._.]+)/commit/([a-z0-9-]+)",

View File

@ -1,10 +1,5 @@
local golem = {} local golem = {}
local http = require('socket.http')
local json = require('dkjson')
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
function golem:init(config) function golem:init(config)
if not cred_data.golem_apikey then if not cred_data.golem_apikey then
print('Missing config value: golem_apikey.') print('Missing config value: golem_apikey.')

View File

@ -1,9 +1,5 @@
local googl = {} local googl = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
function googl:init(config) function googl:init(config)
if not cred_data.google_apikey then if not cred_data.google_apikey then
print('Missing config value: google_apikey.') print('Missing config value: google_apikey.')

View File

@ -1,8 +1,5 @@
local gps = {} local gps = {}
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
gps.command = 'gps <Breitengrad>,<Längengrad>' gps.command = 'gps <Breitengrad>,<Längengrad>'
function gps:init(config) function gps:init(config)

View File

@ -4,8 +4,6 @@
local greetings = {} local greetings = {}
local utilities = require('otouto.utilities')
function greetings:init(config) function greetings:init(config)
config.greetings = config.greetings or { config.greetings = config.greetings or {
['Hello, #NAME.'] = { ['Hello, #NAME.'] = {

View File

@ -1,10 +1,5 @@
local hackernews = {} local hackernews = {}
local https = require('ssl.https')
local json = require('dkjson')
local URL = require('socket.url')
local utilities = require('otouto.utilities')
hackernews.triggers = { hackernews.triggers = {
"news.ycombinator.com/item%?id=(%d+)" "news.ycombinator.com/item%?id=(%d+)"
} }

View File

@ -1,11 +1,5 @@
local heise = {} local heise = {}
local https = require('ssl.https')
local URL = require('socket.url')
local json = require('dkjson')
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
heise.triggers = { heise.triggers = {
"heise.de/newsticker/meldung/(.*).html$" "heise.de/newsticker/meldung/(.*).html$"
} }

View File

@ -1,7 +1,5 @@
local hello = {} local hello = {}
local utilities = require('otouto.utilities')
hello.triggers = { hello.triggers = {
"^[Ss][Aa][Gg] [Hh][Aa][Ll][Ll][Oo] [Zz][Uu] (.*)$" "^[Ss][Aa][Gg] [Hh][Aa][Ll][Ll][Oo] [Zz][Uu] (.*)$"
} }

View File

@ -3,8 +3,6 @@
local help = {} local help = {}
local utilities = require('otouto.utilities')
local help_text local help_text
function help:init(config) function help:init(config)

View File

@ -1,9 +1,5 @@
local id = {} local id = {}
local redis = (loadfile "./otouto/redis.lua")()
local bindings = require('otouto.bindings')
local utilities = require('otouto.utilities')
id.command = 'id' id.command = 'id'
function id:init(config) function id:init(config)

View File

@ -1,11 +1,5 @@
local ifttt = {} local ifttt = {}
local https = require('ssl.https')
local URL = require('socket.url')
local redis = (loadfile "./otouto/redis.lua")()
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
function ifttt:init(config) function ifttt:init(config)
ifttt.triggers = { ifttt.triggers = {
"^/ifttt (!set) (.*)$", "^/ifttt (!set) (.*)$",

View File

@ -1,6 +1,5 @@
local images = {} local images = {}
local utilities = require('otouto.utilities')
images.triggers = { images.triggers = {
"(https?://[%w-_%%%.%?%.:,/%+=~&%[%]]+%.[Pp][Nn][Gg])$", "(https?://[%w-_%%%.%?%.:,/%+=~&%[%]]+%.[Pp][Nn][Gg])$",
"(https?://[%w-_%%%.%?%.:,/%+=~&%[%]]+%.[Jj][Pp][Ee]?[Gg])$" "(https?://[%w-_%%%.%?%.:,/%+=~&%[%]]+%.[Jj][Pp][Ee]?[Gg])$"

View File

@ -1,11 +1,5 @@
local imdb = {} local imdb = {}
local HTTP = require('socket.http')
local URL = require('socket.url')
local JSON = require('dkjson')
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
imdb.command = 'imdb <query>' imdb.command = 'imdb <query>'
function imdb:init(config) function imdb:init(config)
@ -29,13 +23,13 @@ function imdb:action(msg, config)
local url = 'http://www.omdbapi.com/?t=' .. URL.escape(input) local url = 'http://www.omdbapi.com/?t=' .. URL.escape(input)
local jstr, res = HTTP.request(url) local jstr, res = http.request(url)
if res ~= 200 then if res ~= 200 then
utilities.send_reply(self, msg, config.errors.connection) utilities.send_reply(self, msg, config.errors.connection)
return return
end end
local jdat = JSON.decode(jstr) local jdat = json.decode(jstr)
if jdat.Response ~= 'True' then if jdat.Response ~= 'True' then
utilities.send_reply(self, msg, config.errors.results) utilities.send_reply(self, msg, config.errors.results)

View File

@ -1,8 +1,5 @@
local imgblacklist = {} local imgblacklist = {}
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
imgblacklist.command = 'imgblacklist' imgblacklist.command = 'imgblacklist'
function imgblacklist:init(config) function imgblacklist:init(config)

View File

@ -1,9 +1,5 @@
local imgur = {} local imgur = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
function imgur:init(config) function imgur:init(config)
if not cred_data.imgur_client_id then if not cred_data.imgur_client_id then
print('Missing config value: imgur_client_id.') print('Missing config value: imgur_client_id.')

View File

@ -1,10 +1,5 @@
local instagram = {} local instagram = {}
local https = require('ssl.https')
local json = require('dkjson')
local URL = require('socket.url')
local utilities = require('otouto.utilities')
function instagram:init(config) function instagram:init(config)
if not cred_data.instagram_access_token then if not cred_data.instagram_access_token then
print('Missing config value: instagram_access_token.') print('Missing config value: instagram_access_token.')

View File

@ -1,10 +1,5 @@
local ip_info = {} local ip_info = {}
local http = require('socket.http')
local json = require('dkjson')
local URL = require('socket.url')
local utilities = require('otouto.utilities')
function ip_info:init(config) function ip_info:init(config)
ip_info.triggers = { ip_info.triggers = {
"^/ip (.*)$", "^/ip (.*)$",

View File

@ -1,10 +1,6 @@
local isup = {} local isup = {}
local http = require('socket.http')
local https = require('ssl.https')
local socket = require('socket') local socket = require('socket')
local URL = require('socket.url')
local utilities = require('otouto.utilities')
function isup:init(config) function isup:init(config)
isup.triggers = { isup.triggers = {

View File

@ -1,8 +1,5 @@
local leave_group = {} local leave_group = {}
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
leave_group.triggers = { leave_group.triggers = {
'/nil' '/nil'
} }

View File

@ -1,8 +1,5 @@
local loc_manager = {} local loc_manager = {}
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
function loc_manager:init(config) function loc_manager:init(config)
loc_manager.triggers = { loc_manager.triggers = {
"^/location (set) (.*)$", "^/location (set) (.*)$",

View File

@ -1,9 +1,5 @@
local luarun = {} local luarun = {}
local utilities = require('otouto.utilities')
local URL = require('socket.url')
local JSON = require('dkjson')
function luarun:init(config) function luarun:init(config)
luarun.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('lua', true):t('return', true).table luarun.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('lua', true):t('return', true).table
end end
@ -28,17 +24,17 @@ function luarun:action(msg, config)
local bot = require('otouto.bot') local bot = require('otouto.bot')
local bindings = require('otouto.bindings') local bindings = require('otouto.bindings')
local utilities = require('otouto.utilities') local utilities = require('otouto.utilities')
local JSON = require('dkjson') local json = require('dkjson')
local URL = require('socket.url') local URL = require('socket.url')
local HTTP = require('socket.http') local http = require('socket.http')
local HTTPS = require('ssl.https') local https = require('ssl.https')
return function (self, msg, config) ]] .. input .. [[ end return function (self, msg, config) ]] .. input .. [[ end
]] )()(self, msg, config) ]] )()(self, msg, config)
if output == nil then if output == nil then
output = 'Done!' output = 'Done!'
else else
if type(output) == 'table' then if type(output) == 'table' then
local s = JSON.encode(output, {indent=true}) local s = json.encode(output, {indent=true})
if URL.escape(s):len() < 4000 then if URL.escape(s):len() < 4000 then
output = s output = s
end end

View File

@ -1,9 +1,5 @@
local lyrics = {} local lyrics = {}
local http = require('socket.http')
local json = require('dkjson')
local utilities = require('otouto.utilities')
function lyrics:init(config) function lyrics:init(config)
if not cred_data.lyricsnmusic_apikey then if not cred_data.lyricsnmusic_apikey then
print('Missing config value: lyricsnmusic_apikey.') print('Missing config value: lyricsnmusic_apikey.')

View File

@ -1,7 +1,5 @@
local muschel = {} local muschel = {}
local utilities = require('otouto.utilities')
muschel.triggers = { muschel.triggers = {
"^[Mm][Aa][Gg][Ii][Ss][Cc][Hh][Ee] [Mm][Ii][Ee][Ss][Mm][Uu][Ss][Cc][Hh][Ee][Ll], (.*)$" "^[Mm][Aa][Gg][Ii][Ss][Cc][Hh][Ee] [Mm][Ii][Ee][Ss][Mm][Uu][Ss][Cc][Hh][Ee][Ll], (.*)$"
} }

View File

@ -1,11 +1,5 @@
local media = {} local media = {}
local HTTP = require('socket.http')
local HTTPS = require('ssl.https')
local redis = (loadfile "./otouto/redis.lua")()
local utilities = require('otouto.utilities')
local mimetype = (loadfile "./otouto/mimetype.lua")()
media.triggers = { media.triggers = {
"(https?://[%w-_%.%?%.:,/%+=&%[%]]+%.(gif))$", "(https?://[%w-_%.%?%.:,/%+=&%[%]]+%.(gif))$",
"^(https?://[%w-_%.%?%.:,/%+=&%[%]]+%.(mp4))$", "^(https?://[%w-_%.%?%.:,/%+=&%[%]]+%.(mp4))$",

View File

@ -1,11 +1,5 @@
local mc_server = {} local mc_server = {}
local http = require('socket.http')
local ltn12 = require('ltn12')
local URL = require('socket.url')
local json = require('dkjson')
local utilities = require('otouto.utilities')
function mc_server:init(config) function mc_server:init(config)
mc_server.triggers = { mc_server.triggers = {
"^/mine (.*)$" "^/mine (.*)$"

View File

@ -1,7 +1,5 @@
local mc_skin = {} local mc_skin = {}
local utilities = require('otouto.utilities')
function mc_skin:init(config) function mc_skin:init(config)
mc_skin.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('skin', true).table mc_skin.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('skin', true).table
mc_skin.doc = [[* mc_skin.doc = [[*

View File

@ -1,10 +1,6 @@
local mal = {} local mal = {}
local http = require('socket.http')
local URL = require('socket.url')
local xml = require("xml") local xml = require("xml")
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
mal.command = 'anime <Anime>, /manga <Manga>' mal.command = 'anime <Anime>, /manga <Manga>'

View File

@ -3,9 +3,6 @@
local notify = {} local notify = {}
local redis = (loadfile "./otouto/redis.lua")()
local utilities = require('otouto.utilities')
function notify:init(config) function notify:init(config)
notify.triggers = { notify.triggers = {
"^/notify (del)$", "^/notify (del)$",

View File

@ -1,9 +1,5 @@
local pagespeed_insights = {} local pagespeed_insights = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
function pagespeed_insights:init(config) function pagespeed_insights:init(config)
if not cred_data.google_apikey then if not cred_data.google_apikey then
print('Missing config value: google_apikey.') print('Missing config value: google_apikey.')

View File

@ -1,8 +1,5 @@
local pasteee = {} local pasteee = {}
local bot = require('otouto.bot')
local utilities = require('otouto.utilities')
function pasteee:init(config) function pasteee:init(config)
if not cred_data.pasteee_key then if not cred_data.pasteee_key then
print('Missing config value: pasteee_key.') print('Missing config value: pasteee_key.')

View File

@ -1,7 +1,5 @@
local patterns = {} local patterns = {}
local utilities = require('otouto.utilities')
patterns.triggers = { patterns.triggers = {
'^/?s/.-/.-$' '^/?s/.-/.-$'
} }

View File

@ -1,10 +1,5 @@
local pixabay = {} local pixabay = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
function pixabay:init(config) function pixabay:init(config)
if not cred_data.pixabay_apikey then if not cred_data.pixabay_apikey then
print('Missing config value: pixabay_apikey.') print('Missing config value: pixabay_apikey.')

View File

@ -1,9 +1,5 @@
local play_store = {} local play_store = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
function play_store:init(config) function play_store:init(config)
if not cred_data.x_mashape_key then if not cred_data.x_mashape_key then
print('Missing config value: x_mashape_key.') print('Missing config value: x_mashape_key.')

View File

@ -1,9 +1,6 @@
local plugin_manager = {} local plugin_manager = {}
local bot = require('otouto.bot') local bot = require('otouto.bot')
local bindings = require('otouto.bindings')
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
function plugin_manager:init(config) function plugin_manager:init(config)
plugin_manager.triggers = { plugin_manager.triggers = {

View File

@ -1,11 +1,5 @@
local pocket = {} local pocket = {}
local https = require('ssl.https')
local URL = require('socket.url')
local redis = (loadfile "./otouto/redis.lua")()
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
function pocket:init(config) function pocket:init(config)
if not cred_data.pocket_consumer_key then if not cred_data.pocket_consumer_key then
print('Missing config value: pocket_consumer_key.') print('Missing config value: pocket_consumer_key.')

View File

@ -1,10 +1,5 @@
local pokedex = {} local pokedex = {}
local HTTP = require('socket.http')
local JSON = require('dkjson')
local bindings = require('otouto.bindings')
local utilities = require('otouto.utilities')
pokedex.command = 'pokedex <query>' pokedex.command = 'pokedex <query>'
function pokedex:init(config) function pokedex:init(config)
@ -33,22 +28,22 @@ function pokedex:action(msg, config)
local url = 'http://pokeapi.co' local url = 'http://pokeapi.co'
local dex_url = url .. '/api/v1/pokemon/' .. input local dex_url = url .. '/api/v1/pokemon/' .. input
local dex_jstr, res = HTTP.request(dex_url) local dex_jstr, res = http.request(dex_url)
if res ~= 200 then if res ~= 200 then
utilities.send_reply(self, msg, config.errors.connection) utilities.send_reply(self, msg, config.errors.connection)
return return
end end
local dex_jdat = JSON.decode(dex_jstr) local dex_jdat = json.decode(dex_jstr)
local desc_url = url .. dex_jdat.descriptions[math.random(#dex_jdat.descriptions)].resource_uri local desc_url = url .. dex_jdat.descriptions[math.random(#dex_jdat.descriptions)].resource_uri
local desc_jstr, _ = HTTP.request(desc_url) local desc_jstr, _ = http.request(desc_url)
if res ~= 200 then if res ~= 200 then
utilities.send_reply(self, msg, config.errors.connection) utilities.send_reply(self, msg, config.errors.connection)
return return
end end
local desc_jdat = JSON.decode(desc_jstr) local desc_jdat = json.decode(desc_jstr)
local poke_type local poke_type
for _,v in ipairs(dex_jdat.types) do for _,v in ipairs(dex_jdat.types) do

View File

@ -1,8 +1,5 @@
local preview = {} local preview = {}
local HTTP = require('socket.http')
local utilities = require('otouto.utilities')
preview.command = 'preview <link>' preview.command = 'preview <link>'
function preview:init(config) function preview:init(config)
@ -27,7 +24,7 @@ function preview:action(msg)
input = 'http://' .. input input = 'http://' .. input
end end
local res = HTTP.request(input) local res = http.request(input)
if not res then if not res then
utilities.send_reply(self, msg, 'Please provide a valid link.') utilities.send_reply(self, msg, 'Please provide a valid link.')
return return

View File

@ -1,9 +1,5 @@
local qr = {} local qr = {}
local http = require('socket.http')
local URL = require('socket.url')
local utilities = require('otouto.utilities')
function qr:init(config) function qr:init(config)
qr.triggers = { qr.triggers = {
'^/qr "(%w+)" "(%w+)" (.+)$', '^/qr "(%w+)" "(%w+)" (.+)$',

View File

@ -1,8 +1,5 @@
local quotes = {} local quotes = {}
local bot = require('otouto.bot')
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
require("./otouto/plugins/pasteee") require("./otouto/plugins/pasteee")
function quotes:init(config) function quotes:init(config)

View File

@ -1,7 +1,5 @@
local fun = {} local fun = {}
local utilities = require('otouto.utilities')
function fun:init(config) function fun:init(config)
fun.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('random', true).table fun.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('random', true).table
fun.doc = [[* fun.doc = [[*

View File

@ -1,10 +1,5 @@
local reddit = {} local reddit = {}
local https = require('ssl.https')
local URL = require('socket.url')
local JSON = require('dkjson')
local utilities = require('otouto.utilities')
reddit.command = 'reddit [r/subreddit | Suchbegriff]' reddit.command = 'reddit [r/subreddit | Suchbegriff]'
function reddit:init(config) function reddit:init(config)
@ -68,7 +63,7 @@ function reddit:action(msg, config)
if res ~= 200 then if res ~= 200 then
utilities.send_reply(self, msg, config.errors.results) utilities.send_reply(self, msg, config.errors.results)
else else
local jdat = JSON.decode(jstr) local jdat = json.decode(jstr)
if #jdat.data.children == 0 then if #jdat.data.children == 0 then
utilities.send_reply(self, msg, config.errors.results) utilities.send_reply(self, msg, config.errors.results)
else else

View File

@ -1,10 +1,5 @@
local reddit_post = {} local reddit_post = {}
local https = require('ssl.https')
local URL = require('socket.url')
local json = require('dkjson')
local utilities = require('otouto.utilities')
reddit_post.triggers = { reddit_post.triggers = {
"reddit.com/r/([A-Za-z0-9-/-_-.]+)/comments/([A-Za-z0-9-/-_-.]+)" "reddit.com/r/([A-Za-z0-9-/-_-.]+)/comments/([A-Za-z0-9-/-_-.]+)"
} }

View File

@ -1,7 +1,5 @@
local remind = {} local remind = {}
local utilities = require('otouto.utilities')
remind.command = 'remind <Länge> <Nachricht>' remind.command = 'remind <Länge> <Nachricht>'
function remind:init(config) function remind:init(config)

View File

@ -1,9 +1,5 @@
local respond = {} local respond = {}
local https = require('ssl.https')
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
function respond:init(config) function respond:init(config)
respond.triggers = { respond.triggers = {
"([Ff][Gg][Tt].? [Ss][Ww][Ii][Ff][Tt])", "([Ff][Gg][Tt].? [Ss][Ww][Ii][Ff][Tt])",

View File

@ -1,7 +1,5 @@
local roll = {} local roll = {}
local utilities = require('otouto.utilities')
roll.command = 'roll' roll.command = 'roll'
function roll:init(config) function roll:init(config)

View File

@ -1,11 +1,5 @@
local rss = {} local rss = {}
local http = require('socket.http')
local https = require('ssl.https')
local url = require('socket.url')
local bindings = require('otouto.bindings')
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
local feedparser = require("feedparser") local feedparser = require("feedparser")
rss.command = 'rss <sub/del>' rss.command = 'rss <sub/del>'

View File

@ -1,8 +1,5 @@
local set = {} local set = {}
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
set.command = 'set <Variable> <Wert>' set.command = 'set <Variable> <Wert>'
function set:init(config) function set:init(config)

View File

@ -1,7 +1,5 @@
local shell = {} local shell = {}
local utilities = require('otouto.utilities')
function shell:init(config) function shell:init(config)
shell.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('sh', true).table shell.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('sh', true).table
end end

View File

@ -1,7 +1,5 @@
local site_header = {} local site_header = {}
local utilities = require('otouto.utilities')
function site_header:init(config) function site_header:init(config)
site_header.triggers = { site_header.triggers = {
"^/(head) ([%w-_%.%?%.:,/%+=&#!]+)$", "^/(head) ([%w-_%.%?%.:,/%+=&#!]+)$",

View File

@ -1,9 +1,5 @@
local soundcloud = {} local soundcloud = {}
local http = require('socket.http')
local json = require('dkjson')
local utilities = require('otouto.utilities')
soundcloud.triggers = { soundcloud.triggers = {
"soundcloud.com/([A-Za-z0-9-/-_-.]+)" "soundcloud.com/([A-Za-z0-9-/-_-.]+)"
} }

View File

@ -1,7 +1,5 @@
local speedtest = {} local speedtest = {}
local utilities = require('otouto.utilities')
speedtest.triggers = { speedtest.triggers = {
"speedtest.net/my%-result/(%d+)", "speedtest.net/my%-result/(%d+)",
"speedtest.net/my%-result/i/(%d+)" "speedtest.net/my%-result/i/(%d+)"

View File

@ -1,9 +1,5 @@
local spotify = {} local spotify = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
spotify.triggers = { spotify.triggers = {
"open.spotify.com/track/([A-Za-z0-9-]+)", "open.spotify.com/track/([A-Za-z0-9-]+)",
"play.spotify.com/track/([A-Za-z0-9-]+)" "play.spotify.com/track/([A-Za-z0-9-]+)"

View File

@ -1,8 +1,5 @@
local stats = {} local stats = {}
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
function stats:init(config) function stats:init(config)
stats.triggers = { stats.triggers = {
"^/([Ss]tats)$", "^/([Ss]tats)$",

View File

@ -1,10 +1,5 @@
local steam = {} local steam = {}
local utilities = require('otouto.utilities')
local http = require('socket.http')
local json = require('dkjson')
local bindings = require('otouto.bindings')
steam.triggers = { steam.triggers = {
"store.steampowered.com/app/([0-9]+)", "store.steampowered.com/app/([0-9]+)",
"steamcommunity.com/app/([0-9]+)" "steamcommunity.com/app/([0-9]+)"

View File

@ -1,9 +1,5 @@
local streamable = {} local streamable = {}
local https = require('ssl.https')
local json = require('dkjson')
local utilities = require('otouto.utilities')
streamable.triggers = { streamable.triggers = {
"streamable.com/([A-Za-z0-9-_-]+)", "streamable.com/([A-Za-z0-9-_-]+)",
} }

View File

@ -1,7 +1,5 @@
local surrogate = {} local surrogate = {}
local utilities = require('otouto.utilities')
surrogate.triggers = { surrogate.triggers = {
"^/s (%-%d+) +(.+)$", "^/s (%-%d+) +(.+)$",
"^/s (%d+) +(.+)$" "^/s (%d+) +(.+)$"

View File

@ -1,11 +1,5 @@
local tagesschau = {} local tagesschau = {}
local https = require('ssl.https')
local URL = require('socket.url')
local json = require('dkjson')
local utilities = require('otouto.utilities')
local bindings = require('otouto.bindings')
tagesschau.triggers = { tagesschau.triggers = {
"tagesschau.de/([A-Za-z0-9-_-_-/]+).html" "tagesschau.de/([A-Za-z0-9-_-_-/]+).html"
} }

View File

@ -1,12 +1,5 @@
local tagesschau_eil = {} local tagesschau_eil = {}
local http = require('socket.http')
local https = require('ssl.https')
local url = require('socket.url')
local json = require('dkjson')
local utilities = require('otouto.utilities')
local redis = (loadfile "./otouto/redis.lua")()
tagesschau_eil.command = 'eil <sub/del>' tagesschau_eil.command = 'eil <sub/del>'
function tagesschau_eil:init(config) function tagesschau_eil:init(config)

Some files were not shown because too many files have changed in this diff Show More