Kleinere Fixes in verschiedene Plugins
This commit is contained in:
parent
6e4ff13e59
commit
f53481f8de
2
.gitignore
vendored
2
.gitignore
vendored
@ -20,3 +20,5 @@ plugins/figuya.lua
|
||||
plugins/plex_info.lua
|
||||
plugins/plex_last.lua
|
||||
plugins/akamaru.lua
|
||||
plugins/brawlbot.lua
|
||||
plugins/strawpoll.lua
|
@ -563,6 +563,7 @@ function unescape(str)
|
||||
str = string.gsub(str, "‹", "‹")
|
||||
str = string.gsub(str, "€", "€")
|
||||
str = string.gsub(str, "♪", "♪")
|
||||
str = string.gsub(str, "<EFBFBD>", "")
|
||||
|
||||
-- Ä Ö Ü
|
||||
str = string.gsub(str, "ä", "ä")
|
||||
|
@ -38,9 +38,9 @@ local function switch_afk(user_name, user_id, chat_id, timestamp, text)
|
||||
if text then
|
||||
print('Setting redis hash afk_text in '..hash..' to '..text)
|
||||
redis:hset(hash, 'afk_text', text)
|
||||
return user_name..' ist AFK ('..text..')'
|
||||
return user_name..' ist AFK! ('..text..')'
|
||||
else
|
||||
return user_name..' ist AFK'
|
||||
return user_name..' ist AFK!'
|
||||
end
|
||||
end
|
||||
|
||||
@ -90,7 +90,7 @@ end
|
||||
|
||||
local function run(msg, matches)
|
||||
if msg.to.type ~= "chat" then
|
||||
return "Mir ist's egal, ob du AFK bist ._."
|
||||
return "Mir ist's egal, ob du AFK bist."
|
||||
end
|
||||
|
||||
local user_id = msg.from.id
|
||||
|
@ -1,17 +1,17 @@
|
||||
do
|
||||
|
||||
local function get_ponywave(part)
|
||||
local url = 'http://img.akamaru.de/'..part..'.html'
|
||||
local function get_aka_img(img)
|
||||
local url = 'http://img.akamaru.de/'..img..'.html'
|
||||
local res,code = http.request(url)
|
||||
if code ~= 200 then return "Fehler beim Abrufen von img.ponywave.de" end
|
||||
if code ~= 200 then return "Fehler beim Abrufen von img.akamaru.de" end
|
||||
local url = string.match(res, "id=\"codedirect\" value%=\"(.-)\" onclick")
|
||||
return url
|
||||
end
|
||||
|
||||
local function run(msg, matches)
|
||||
local receiver = get_receiver(msg)
|
||||
local part = matches[1]
|
||||
local url = get_ponywave(part)
|
||||
local img = matches[1]
|
||||
local url = get_aka_img(img)
|
||||
if string.ends(url, ".gif") then
|
||||
send_document_from_url(receiver, url)
|
||||
else
|
||||
@ -28,4 +28,6 @@ return {
|
||||
run = run
|
||||
}
|
||||
|
||||
--by Akamaru [https://ponywave.de]
|
||||
|
||||
end
|
@ -6,7 +6,7 @@ local makeOurDate = function(dateString)
|
||||
return day..'.'..month..'.'..year
|
||||
end
|
||||
|
||||
local function get_post(post)
|
||||
local function get_post()
|
||||
local url = 'http://akamaru.de/?json=get_recent_posts'
|
||||
local res,code = http.request(url)
|
||||
local data = json:decode(res).posts[1]
|
||||
@ -35,7 +35,7 @@ local function get_post(post)
|
||||
end
|
||||
|
||||
local function run(msg, matches)
|
||||
local text, image_url = get_post(post)
|
||||
local text, image_url = get_post()
|
||||
local receiver = get_receiver(msg)
|
||||
if image_url then
|
||||
local file = download_to_file(image_url)
|
||||
@ -45,10 +45,12 @@ local function run(msg, matches)
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Sendet letzten Aka's Blog Beitrag",
|
||||
description = "Sendet den aktuellen Beitrag von Aka's Blog",
|
||||
usage = "#aka",
|
||||
patterns = {"^#[Aa][Kk][Aa]$"},
|
||||
run = run
|
||||
}
|
||||
|
||||
--by Akamaru [https://ponywave.de]
|
||||
|
||||
end
|
@ -52,4 +52,6 @@ return {
|
||||
run = run
|
||||
}
|
||||
|
||||
--by Akamaru [https://ponywave.de]
|
||||
|
||||
end
|
@ -11,6 +11,7 @@ function run(msg, matches)
|
||||
["test"] = "../Festplatten/Dragoran/Mikubot/sfw/test/",
|
||||
["anime"] = "../Festplatten/Dragoran/Mikubot/sfw/anime/",
|
||||
["mlp"] = "../Festplatten/Dragoran/Mikubot/sfw/mlp/",
|
||||
["doge"] = "../Festplatten/Dragoran/Mikubot/sfw/doge/",
|
||||
["faktillon"] = "../Festplatten/Dragoran/Mikubot/sfw/faktillon/",
|
||||
["faktastisch"] = "../Festplatten/Dragoran/Mikubot/sfw/faktastisch/",
|
||||
["gamefakt"] = "../Festplatten/Dragoran/Mikubot/sfw/gamefakt/",
|
||||
@ -31,13 +32,13 @@ function run(msg, matches)
|
||||
return "Fehler: " .. img
|
||||
end
|
||||
else
|
||||
return '"'..imgtype..'" gibt es nicht.\nEs gibt:\nanime\nmlp\nfaktillon\nfaktastisch\ngamefakt\nfaktglaublich'
|
||||
return '"'..imgtype..'" gibt es nicht.\nEs gibt:\nanime\nmlp\ndoge\nfaktillon\nfaktastisch\ngamefakt\nfaktglaublich'
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Sendet ein zufälliges Bild",
|
||||
usage = {"#rpic [Thema]","Themen:","anime","mlp","faktillon","faktastisch","gamefakt","faktglaublich"},
|
||||
usage = {"#rpic [Thema]","Themen:","anime","mlp","doge","faktillon","faktastisch","gamefakt","faktglaublich"},
|
||||
patterns = {"^#rpic (.*)$"},
|
||||
run = run
|
||||
}
|
||||
|
@ -58,6 +58,7 @@ function run(msg, matches)
|
||||
string.match(msg.text, "nico.ms/sm") or
|
||||
string.match(msg.text, "tumblr.com") or
|
||||
string.match(msg.text, "kickstarter.com/projects") or
|
||||
string.match(msg.text, "pr0gramm.com") or
|
||||
string.ends(url, ".jpg") or
|
||||
string.ends(url, ".jpeg") or
|
||||
string.ends(url, ".gif") or
|
||||
|
@ -26,6 +26,12 @@ function send_vimeo_data(data, receiver)
|
||||
local duration = string.format("%02d:%02d", minutes, seconds)
|
||||
|
||||
local text = title..'\n(Hochgeladen von: '..uploader..', '..duration..' Minuten, '..viewCount..' mal angesehen)\n'
|
||||
local image = download_to_file(data[1].thumbnail_large)
|
||||
if string.ends(image, ".webp") then
|
||||
send_document(receiver, image, ok_cb, false)
|
||||
else
|
||||
send_photo(receiver, image, ok_cb, false)
|
||||
end
|
||||
send_msg(receiver, text, ok_cb, false)
|
||||
end
|
||||
|
||||
|
@ -28,7 +28,7 @@ local Wikipedia = {
|
||||
action = "query",
|
||||
prop = "extracts",
|
||||
format = "json",
|
||||
exchars = 300,
|
||||
exchars = 350,
|
||||
exsectionformat = "plain",
|
||||
explaintext = "",
|
||||
redirects = ""
|
||||
@ -115,7 +115,7 @@ function Wikipedia:wikintro(text, lang)
|
||||
local lang = lang or "de"
|
||||
local title = page.title
|
||||
local title_enc = URL.escape(title)
|
||||
return title..":\n"..page.extract.."\n -- https://"..lang..".wikipedia.org/wiki/"..title_enc
|
||||
return title.."\n"..unescape(page.extract).."\n -- https://"..lang..".wikipedia.org/wiki/"..title_enc
|
||||
else
|
||||
local text = '"'..text..'" nicht gefunden.'
|
||||
return text
|
||||
|
@ -129,6 +129,8 @@ function run(msg, matches)
|
||||
local yt_code = matches[1]
|
||||
local data = get_yt_data(yt_code)
|
||||
local receiver = get_receiver(msg)
|
||||
local thumb = download_to_file('http://i.ytimg.com/vi_webp/'..yt_code..'/hqdefault.webp')
|
||||
send_document(receiver, thumb, ok_cb, false)
|
||||
send_youtube_data(data, receiver)
|
||||
end
|
||||
|
||||
|
@ -16,7 +16,7 @@ function run(msg, matches)
|
||||
else
|
||||
file = 'tmp/'..video
|
||||
end
|
||||
send_video(get_receiver(msg), file, ok_cb, false)
|
||||
send_document(get_receiver(msg), file, ok_cb, false)
|
||||
end
|
||||
|
||||
if string.match(msg.text, "#mp3") then
|
||||
@ -33,6 +33,7 @@ function run(msg, matches)
|
||||
message = string.gsub(message, ".mp4", "")
|
||||
message = string.gsub(message, ".mkv", "")
|
||||
message = string.gsub(message, ".flv", "")
|
||||
message = string.gsub(message, ".webm", "")
|
||||
return message
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user