Fuck ANSI!!!

This commit is contained in:
Akamaru 2016-01-30 21:18:12 +01:00
parent f04437a829
commit e92ecd97f2
2 changed files with 11 additions and 8 deletions

5
.gitignore vendored
View File

@ -9,4 +9,7 @@ plugins/help2.lua
plugins/pegelf_img.lua plugins/pegelf_img.lua
plugins/plex.lua plugins/plex.lua
plugins/chantalle.lua plugins/chantalle.lua
plugins/plex_xml.lua plugins/plex_xml.lua
plugins/tumblr_blog.lua
plugins/tumblr_post.lua
plugins/wiiu.lua

View File

@ -7,11 +7,11 @@ local _blacklist
local function show_blacklist() local function show_blacklist()
if not _blacklist[1] then if not _blacklist[1] then
return "Keine Wörter geblacklisted!\nBlackliste welche mit !imgblacklist add [Wort]" return "Keine Wörter geblacklisted!\nBlackliste welche mit /imgblacklist add [Wort]"
else else
local sort_alph = function( a,b ) return a < b end local sort_alph = function( a,b ) return a < b end
table.sort( _blacklist, sort_alph ) table.sort( _blacklist, sort_alph )
local blacklist = "Folgende Wörter stehen auf der Blacklist:\n" local blacklist = "Folgende Wörter stehen auf der Blacklist:\n"
for v,word in pairs(_blacklist) do for v,word in pairs(_blacklist) do
blacklist = blacklist..'- '..word..'\n' blacklist = blacklist..'- '..word..'\n'
end end
@ -33,7 +33,7 @@ local function remove_blacklist()
print('De-blacklisting '..word..' - removing from redis set telegram:img_blacklist') print('De-blacklisting '..word..' - removing from redis set telegram:img_blacklist')
if redis:sismember("telegram:img_blacklist", word) == true then if redis:sismember("telegram:img_blacklist", word) == true then
redis:srem("telegram:img_blacklist", word) redis:srem("telegram:img_blacklist", word)
return '"'..word..'" erfolgreich von der Blacklist gelöscht!' return '"'..word..'" erfolgreich von der Blacklist gelöscht!'
else else
return '"'..word..'" steht nicht auf der Blacklist.' return '"'..word..'" steht nicht auf der Blacklist.'
end end
@ -45,13 +45,13 @@ function run(msg, matches)
_blacklist = redis:smembers("telegram:img_blacklist") _blacklist = redis:smembers("telegram:img_blacklist")
if action == "add" and word == nil then if action == "add" and word == nil then
return "Benutzung: !imgblacklist add [Wort]" return "Benutzung: /imgblacklist add [Wort]"
elseif action == "add" and word then elseif action == "add" and word then
return add_blacklist() return add_blacklist()
end end
if action == "remove" and word == nil then if action == "remove" and word == nil then
return "Benutzung: !imgblacklist remove [Wort]" return "Benutzung: /imgblacklist remove [Wort]"
elseif action == "remove" and word then elseif action == "remove" and word then
return remove_blacklist() return remove_blacklist()
end end
@ -60,10 +60,10 @@ function run(msg, matches)
end end
return { return {
description = "Blacklist-Manager für Bilder-Plugins (nur Superuser)", description = "Blacklist-Manager für Bilder-Plugins (nur Superuser)",
usage = { usage = {
"/imgblacklist show: Zeigt Blacklist", "/imgblacklist show: Zeigt Blacklist",
"/imgblacklist add [Wort]: Fügt Wort der Blacklist hinzu", "/imgblacklist add [Wort]: Fügt Wort der Blacklist hinzu",
"/imgblacklist remove [Wort]: Entfernt Wort aus der Blacklist" "/imgblacklist remove [Wort]: Entfernt Wort aus der Blacklist"
}, },
patterns = { patterns = {