more german translation and optimizations
This commit is contained in:
parent
ef6e633da9
commit
0c97b53d58
50
bot/bot.lua
50
bot/bot.lua
@ -38,33 +38,33 @@ end
|
||||
function msg_valid(msg)
|
||||
-- Dont process outgoing messages
|
||||
if msg.out then
|
||||
print('\27[36mNot valid: msg from us\27[39m')
|
||||
print('\27[36mNicht gültig: Nachricht von mir\27[39m')
|
||||
return false
|
||||
end
|
||||
|
||||
-- Before bot was started
|
||||
if msg.date < now then
|
||||
print('\27[36mNot valid: old msg\27[39m')
|
||||
print('\27[36mNicht gültig: alte Nachricht\27[39m')
|
||||
return false
|
||||
end
|
||||
|
||||
if msg.unread == 0 then
|
||||
print('\27[36mNot valid: readed\27[39m')
|
||||
print('\27[36mNicht gültig: gelesen\27[39m')
|
||||
return false
|
||||
end
|
||||
|
||||
if msg.service then
|
||||
print('\27[36mNot valid: service\27[39m')
|
||||
print('\27[36mNicht gültig: Service\27[39m')
|
||||
return false
|
||||
end
|
||||
|
||||
if not msg.to.id then
|
||||
print('\27[36mNot valid: To id not provided\27[39m')
|
||||
print('\27[36mNicht gültig: To id not provided\27[39m')
|
||||
return false
|
||||
end
|
||||
|
||||
if not msg.from.id then
|
||||
print('\27[36mNot valid: From id not provided\27[39m')
|
||||
print('\27[36mNicht gültig: From id not provided\27[39m')
|
||||
return false
|
||||
end
|
||||
|
||||
@ -114,7 +114,7 @@ function match_plugin(plugin, plugin_name, msg)
|
||||
for k, pattern in pairs(plugin.patterns) do
|
||||
local matches = match_pattern(pattern, msg.text)
|
||||
if matches then
|
||||
print("msg matches: ", pattern)
|
||||
print("Nachricht stimmt überein mit ", pattern)
|
||||
|
||||
if is_plugin_disabled_on_chat(plugin_name, receiver) then
|
||||
return nil
|
||||
@ -150,7 +150,7 @@ end
|
||||
-- Save the content of _config to config.lua
|
||||
function save_config( )
|
||||
serialize_to_file(_config, './data/config.lua')
|
||||
print ('saved config into ./data/config.lua')
|
||||
print ('Configuration in ./data/config.lua gespeichert')
|
||||
end
|
||||
|
||||
-- Returns the config from config.lua file.
|
||||
@ -159,14 +159,14 @@ function load_config( )
|
||||
local f = io.open('./data/config.lua', "r")
|
||||
-- If config.lua doesnt exists
|
||||
if not f then
|
||||
print ("Created new config file: data/config.lua")
|
||||
print ("Neue Config-Datei erstellt: data/config.lua")
|
||||
create_config()
|
||||
else
|
||||
f:close()
|
||||
end
|
||||
local config = loadfile ("./data/config.lua")()
|
||||
for v,user in pairs(config.sudo_users) do
|
||||
print("Allowed user: " .. user)
|
||||
print("Erlaubter Benutzer: " .. user)
|
||||
end
|
||||
return config
|
||||
end
|
||||
@ -175,7 +175,7 @@ function load_cred( )
|
||||
local cf = io.open('./data/credentials.lua', "r")
|
||||
-- If credentials.lua doesnt exists
|
||||
if not cf then
|
||||
print ("Created new credentials file: data/credentials.lua")
|
||||
print ("Neue Credentials-Datei erstellt: data/credentials.lua")
|
||||
create_cred()
|
||||
else
|
||||
cf:close()
|
||||
@ -189,33 +189,13 @@ function create_config( )
|
||||
-- A simple config with basic plugins and ourserves as priviled user
|
||||
config = {
|
||||
enabled_plugins = {
|
||||
"9gag",
|
||||
"eur",
|
||||
"echo",
|
||||
"btc",
|
||||
"get",
|
||||
"giphy",
|
||||
"google",
|
||||
"gps",
|
||||
"help",
|
||||
"images",
|
||||
"img_google",
|
||||
"location",
|
||||
"media",
|
||||
"plugins",
|
||||
"channels",
|
||||
"set",
|
||||
"stats",
|
||||
"time",
|
||||
"version",
|
||||
"weather",
|
||||
"xkcd",
|
||||
"youtube" },
|
||||
"plugins" },
|
||||
sudo_users = {our_id},
|
||||
disabled_channels = {}
|
||||
}
|
||||
serialize_to_file(config, './data/config.lua')
|
||||
print ('saved config into ./data/config.lua')
|
||||
print ('Configuration in ./data/config.lua gespeichert')
|
||||
end
|
||||
|
||||
function create_cred( )
|
||||
@ -243,7 +223,7 @@ function create_cred( )
|
||||
yandex_rich_content_apikey = ""
|
||||
}
|
||||
serialize_to_file(cred, './data/credentials.lua')
|
||||
print ('saved credentials into ./data/credentials.lua')
|
||||
print ('Credentials gespeichert in ./data/credentials.lua')
|
||||
end
|
||||
|
||||
function on_our_id (id)
|
||||
@ -268,7 +248,7 @@ end
|
||||
-- Enable plugins in config.json
|
||||
function load_plugins()
|
||||
for k, v in pairs(_config.enabled_plugins) do
|
||||
print("Loading plugin", v)
|
||||
print("Lade Plugin", v)
|
||||
local t = loadfile("plugins/"..v..'.lua')()
|
||||
plugins[v] = t
|
||||
end
|
||||
|
@ -1,7 +1,6 @@
|
||||
function run(msg, matches)
|
||||
--get username
|
||||
local user_name = get_name(msg)
|
||||
return '' .. user_name .. ' ist nun AFK'
|
||||
return user_name .. ' ist nun AFK'
|
||||
end
|
||||
|
||||
return {
|
||||
|
@ -68,7 +68,7 @@ end
|
||||
|
||||
return {
|
||||
description = "",
|
||||
usage = {"Das kann nur Akamaru"},
|
||||
usage = {"/channel kann nur Akamaru"},
|
||||
patterns = {"^/channel? (enable)","^/channel? (disable)" },
|
||||
run = run,
|
||||
privileged = true,
|
||||
|
@ -5,7 +5,7 @@ end
|
||||
|
||||
return {
|
||||
description = "Zeigt das aktuelle Datum an",
|
||||
usage = "/date",
|
||||
usage = {"/date"},
|
||||
patterns = {"^/date$"},
|
||||
run = run
|
||||
}
|
||||
|
@ -48,12 +48,9 @@ function run(msg, matches)
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Send dmm video info",
|
||||
usage = {"/dmm (id): Send a dmm video cover and title. If not id, send a random one"},
|
||||
patterns = {
|
||||
"^/dmm$",
|
||||
"^/dmm (.+)"
|
||||
},
|
||||
description = "Sendet dmm Video Info",
|
||||
usage = {"/dmm","/dmm (id)"},
|
||||
patterns = {"^/dmm$","^/dmm (.+)"},
|
||||
run = run
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ local function get_value(chat, value_name)
|
||||
end
|
||||
local value = _values[chat][value_name]
|
||||
if ( value == nil) then
|
||||
return "Konnte nicht finden "..value_name
|
||||
return 'Konnte "'..value_name..' nicht finden'
|
||||
end
|
||||
return value_name.." = "..value
|
||||
end
|
||||
@ -69,11 +69,10 @@ local function lex(msg)
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Bekommt Variable, die mit !set gesetzt wurde",
|
||||
usage = "/get (Variable)",
|
||||
patterns = {
|
||||
"^/get (%a+)$",
|
||||
"^/get$"},
|
||||
description = "Bekommt Variable, die mit /set gesetzt wurde",
|
||||
usage = {"/get (Variable)"},
|
||||
patterns = {"^/get (%a+)$","^/get$"},
|
||||
patterns = {"^/get (%a+)$","^/get$"},
|
||||
run = run,
|
||||
pre_process = lex
|
||||
}
|
||||
|
@ -31,11 +31,8 @@ end
|
||||
|
||||
return {
|
||||
description = "Andere User zu einer Chat-Gruppe hinzufügen",
|
||||
usage = "/invite name [user_name], !invite id [user_id]",
|
||||
patterns = {
|
||||
"^/invite (name) (.*)$",
|
||||
"^/invite (id) (%d+)$"
|
||||
},
|
||||
usage = "/invite name [user_name], /invite id [user_id]",
|
||||
patterns = {"^/invite (name) (.*)$","^/invite (id) (%d+)$"},
|
||||
run = run
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ local function save_cron(msg, url, delete)
|
||||
end
|
||||
end
|
||||
serialize_to_file(cronned, 'data/isup.lua')
|
||||
return 'Saved!'
|
||||
return 'Gespeichert!'
|
||||
end
|
||||
|
||||
local function is_up_socket(ip, port)
|
||||
@ -82,7 +82,7 @@ local function cron()
|
||||
for k,url in pairs(urls) do
|
||||
print('Checking', url)
|
||||
if not isup(url) then
|
||||
local text = url..' looks DOWN from here. ??'
|
||||
local text = url..' scheint DOWN zu sein'
|
||||
send_msg(chan, text, ok_cb, false)
|
||||
end
|
||||
end
|
||||
@ -92,20 +92,20 @@ end
|
||||
local function run(msg, matches)
|
||||
if matches[1] == 'remove' then
|
||||
if not is_sudo(msg) then
|
||||
return 'This command requires privileged user'
|
||||
return 'Du darfst diesen Befehl nicht nutzen!'
|
||||
end
|
||||
return save_cron(msg, matches[2], true)
|
||||
|
||||
elseif matches[1] == 'save' then
|
||||
if not is_sudo(msg) then
|
||||
return 'This command requires privileged user'
|
||||
return 'Du darfst diesen Befehl nicht nutzen!'
|
||||
end
|
||||
return save_cron(msg, matches[2])
|
||||
|
||||
elseif isup(matches[1]) then
|
||||
return matches[1]..' looks UP from here. ??'
|
||||
return matches[1]..' ist UP'
|
||||
else
|
||||
return matches[1]..' looks DOWN from here. ??'
|
||||
return matches[1]..' scheint DOWN zu sein'
|
||||
end
|
||||
end
|
||||
|
||||
@ -113,8 +113,8 @@ return {
|
||||
description = "Check if a website or server is up.",
|
||||
usage = {
|
||||
"/isup [host]: Performs a HTTP request or Socket (ip:port) connexion",
|
||||
"/isup cron [host]: Every 5mins check if host is up. (Requires privileged user)",
|
||||
"/isup cron delete [host]: Disable checking that host."
|
||||
"/isup save [host]: Every 5mins check if host is up. (Requires privileged user)",
|
||||
"/isup remove [host]: Disable checking that host."
|
||||
},
|
||||
patterns = {
|
||||
"^/isup (remove) (.*)$",
|
||||
|
@ -11,27 +11,27 @@ local function run(msg, matches)
|
||||
local mime_type = mimetype.get_content_type_no_sub(ext)
|
||||
|
||||
if ext == 'gif' then
|
||||
print('send_file')
|
||||
print('Sende Datei')
|
||||
send_document(receiver, file, rmtmp_cb, cb_extra)
|
||||
|
||||
elseif mime_type == 'text' then
|
||||
print('send_document')
|
||||
print('Sende Document')
|
||||
send_document(receiver, file, rmtmp_cb, cb_extra)
|
||||
|
||||
elseif mime_type == 'image' then
|
||||
print('send_photo')
|
||||
print('Sende Foto')
|
||||
send_photo(receiver, file, rmtmp_cb, cb_extra)
|
||||
|
||||
elseif mime_type == 'audio' then
|
||||
print('send_audio')
|
||||
print('Sende Audio')
|
||||
send_audio(receiver, file, rmtmp_cb, cb_extra)
|
||||
|
||||
elseif mime_type == 'video' then
|
||||
print('send_video')
|
||||
print('Sende Video')
|
||||
send_video(receiver, file, rmtmp_cb, cb_extra)
|
||||
|
||||
else
|
||||
print('send_file')
|
||||
print('Sende Datei')
|
||||
send_document(receiver, file, rmtmp_cb, cb_extra)
|
||||
end
|
||||
|
||||
|
@ -60,7 +60,7 @@ local function parseText(chat, text)
|
||||
if (ip ~= nil) then
|
||||
return mineSearch(ip, "25565", chat)
|
||||
end
|
||||
return "FEHLER: Keine Input IP??"
|
||||
return "FEHLER: Keine Input IP?"
|
||||
end
|
||||
|
||||
|
||||
@ -73,8 +73,6 @@ end
|
||||
return {
|
||||
description = "Dursucht Minecraft-Server und sendet Infos",
|
||||
usage = usage,
|
||||
patterns = {
|
||||
"^/mine (.*)$"
|
||||
},
|
||||
patterns = {"^/mine (.*)$"},
|
||||
run = run
|
||||
}
|
@ -5,7 +5,7 @@ end
|
||||
return {
|
||||
description = "Naira Derp",
|
||||
usage = {"/nairad","/Nairad"},
|
||||
patterns = {"^/nairad","^/Nairad"},
|
||||
patterns = {"^/nairad$","^/Nairad$"},
|
||||
run = run
|
||||
}
|
||||
--by Akamaru
|
@ -4,8 +4,8 @@ end
|
||||
|
||||
return {
|
||||
description = "RTL Nau",
|
||||
usage = {"/nau"},
|
||||
patterns = {"^/nau"},
|
||||
usage = {"/nau","/now"},
|
||||
patterns = {"^/nau$","^/now$"},
|
||||
run = run
|
||||
}
|
||||
--by Akamaru
|
@ -49,7 +49,7 @@ end
|
||||
|
||||
|
||||
local function enable_plugin( plugin_name )
|
||||
print('checking if '..plugin_name..' exists')
|
||||
print('Überprüfe ob "'..plugin_name..'" existiert')
|
||||
-- Check if plugin is enabled
|
||||
if plugin_enabled(plugin_name) then
|
||||
return 'Plugin "'..plugin_name..'" ist aktiviert!'
|
||||
@ -58,19 +58,19 @@ local function enable_plugin( plugin_name )
|
||||
if plugin_exists(plugin_name) then
|
||||
-- Add to the config table
|
||||
table.insert(_config.enabled_plugins, plugin_name)
|
||||
print(plugin_name..' added to _config table')
|
||||
print(plugin_name..' zu to _config table hinzugefügt')
|
||||
save_config()
|
||||
-- Reload the plugins
|
||||
return reload_plugins( )
|
||||
else
|
||||
return 'Das Plugin "'..plugin_name..'" exestiert nicht!'
|
||||
return 'Das Plugin "'..plugin_name..'" existiert nicht!'
|
||||
end
|
||||
end
|
||||
|
||||
local function disable_plugin( name, chat )
|
||||
-- Check if plugins exists
|
||||
if not plugin_exists(name) then
|
||||
return 'Das Plugin "'..plugin_name..'" exestiert nicht!'
|
||||
return 'Das Plugin "'..plugin_name..'" existiert nicht!'
|
||||
end
|
||||
local k = plugin_enabled(name)
|
||||
-- Check if plugin is enabled
|
||||
@ -85,7 +85,7 @@ end
|
||||
|
||||
local function disable_plugin_on_chat(receiver, plugin)
|
||||
if not plugin_exists(plugin) then
|
||||
return "Dieses Plugin exestiert nicht!"
|
||||
return "Dieses Plugin existiert nicht!"
|
||||
end
|
||||
|
||||
if not _config.disabled_plugin_on_chat then
|
||||
@ -104,11 +104,11 @@ end
|
||||
|
||||
local function reenable_plugin_on_chat(receiver, plugin)
|
||||
if not _config.disabled_plugin_on_chat then
|
||||
return 'There aren\'t any disabled plugin.'
|
||||
return 'Hier sind keine Plugins deaktiviert.'
|
||||
end
|
||||
|
||||
if not _config.disabled_plugin_on_chat[receiver] then
|
||||
return 'There aren\'t any disabled plugin for this chat.'
|
||||
return 'Hier sind keine Plugins deaktiviert.'
|
||||
end
|
||||
|
||||
if not _config.disabled_plugin_on_chat[receiver][plugin] then
|
||||
@ -130,14 +130,14 @@ local function run(msg, matches)
|
||||
if matches[1] == 'enable' and matches[3] == 'chat' then
|
||||
local receiver = get_receiver(msg)
|
||||
local plugin = matches[2]
|
||||
print("enable "..plugin..' on this chat')
|
||||
print('Aktiviere "'..plugin..'" in diesem Chat')
|
||||
return reenable_plugin_on_chat(receiver, plugin)
|
||||
end
|
||||
|
||||
-- Enable a plugin
|
||||
if matches[1] == 'enable' then
|
||||
local plugin_name = matches[2]
|
||||
print("enable: "..matches[2])
|
||||
print("A+: "..matches[2])
|
||||
return enable_plugin(plugin_name)
|
||||
end
|
||||
|
||||
@ -145,13 +145,13 @@ local function run(msg, matches)
|
||||
if matches[1] == 'disable' and matches[3] == 'chat' then
|
||||
local plugin = matches[2]
|
||||
local receiver = get_receiver(msg)
|
||||
print("disable "..plugin..' on this chat')
|
||||
print('Deaktiviere "'..plugin..'" in diesem Chat')
|
||||
return disable_plugin_on_chat(receiver, plugin)
|
||||
end
|
||||
|
||||
-- Disable a plugin
|
||||
if matches[1] == 'disable' then
|
||||
print("disable: "..matches[2])
|
||||
print("Deaktiviere: "..matches[2])
|
||||
return disable_plugin(matches[2])
|
||||
end
|
||||
|
||||
|
@ -27,7 +27,7 @@ function save_quote(msg)
|
||||
end
|
||||
|
||||
if quotes_table[to_id] == nil then
|
||||
print ('New quote key to_id: '..to_id)
|
||||
print ('Neuer quote key to_id: '..to_id)
|
||||
quotes_table[to_id] = {}
|
||||
end
|
||||
|
||||
|
@ -5,8 +5,8 @@ function run(msg, matches)
|
||||
end
|
||||
|
||||
return {
|
||||
description = "",
|
||||
usage = "",
|
||||
description = "Läd die Plugins neu",
|
||||
usage = {"/reload (kann nur Akamaru)"},
|
||||
patterns = {"^/reload$"},
|
||||
run = run,
|
||||
privileged = true
|
||||
|
@ -30,7 +30,7 @@ function run(msg, matches)
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Sendet euch ein Char aus Sakurasou no Pet na Kanojo",
|
||||
description = "Sendet euch ein Charakter aus Sakurasou no Pet na Kanojo",
|
||||
usage = {"/shiina","/Shiina","/chihiro","/Chihiro","/jin","/Jin","/misaki","/Misaki","/nanami","/Nanami","/ryuunosuke","/Ryuunosuke","/sorata","/Sorata"},
|
||||
patterns = {"^/shiina","^/Shiina","^/chihiro","^/Chihiro","^/jin","^/Jin","^/misaki","^/Misaki","^/nanami","^/Nanami","^/ryuunosuke","^/Ryuunosuke","^/sorata","^/Sorata"},
|
||||
run = run
|
||||
|
@ -42,7 +42,7 @@ function run(msg, matches)
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Sendet euch ein Senran Kagura Char",
|
||||
description = "Sendet euch ein Senran Kagura Charakter",
|
||||
usage = {"/asuka","/Asuka","/hibari","/Hibari","/ikaruga","/Ikaruga","/katsuragi","/Katsuragi","/yagyuu","/Yagyuu","/haruka","/Haruka","/hikage","/Hikage","/homura","/Homura","/mirai","/Mirai","/yomi","/Yomi"},
|
||||
patterns = {"^/asuka","^/Asuka","^/hibari","^/Hibari","^/ikaruga","^/Ikaruga","^/katsuragi","^/Katsuragi","^/yagyuu","^/Yagyuu","^/haruka","^/Haruka","^/hikage","^/Hikage","^/homura","^/Homura","^/mirai","^/Mirai","^/yomi","^/Yomi"},
|
||||
run = run
|
||||
|
@ -24,7 +24,7 @@ end
|
||||
|
||||
return {
|
||||
description = "Setze Variable",
|
||||
usage = "/set [Variablenname] [Daten]",
|
||||
usage = {"/set [Variablenname] [Daten]"},
|
||||
patterns = {"^/set (%a+) (.+)$"},
|
||||
run = run
|
||||
}
|
@ -32,7 +32,7 @@ end
|
||||
|
||||
return {
|
||||
description = "Führt Befehle in der Konsole aus",
|
||||
usage = {"Das kann nur Akamaru"},
|
||||
usage = {"/sh kann nur Akamaru"},
|
||||
patterns = {"^/uptime", "^/sh (.*)$"},
|
||||
run = run,
|
||||
privileged = true
|
||||
|
@ -12,16 +12,16 @@ function update_user_stats(msg)
|
||||
local from_id = tostring(msg.from.id)
|
||||
local to_id = tostring(msg.to.id)
|
||||
local user_name = get_name(msg)
|
||||
print ('New message from '..user_name..'['..from_id..']'..' to '..to_id)
|
||||
print ('Neue Nachricht von '..user_name..'['..from_id..']'..' in '..to_id)
|
||||
-- If last name is nil dont save last_name.
|
||||
local user_last_name = msg.from.last_name
|
||||
local user_print_name = msg.from.print_name
|
||||
if _stats[to_id] == nil then
|
||||
print ('New stats key to_id: '..to_id)
|
||||
print ('Neuer stats key to_id: '..to_id)
|
||||
_stats[to_id] = {}
|
||||
end
|
||||
if _stats[to_id][from_id] == nil then
|
||||
print ('New stats key from_id: '..to_id)
|
||||
print ('Neuer stats key from_id: '..to_id)
|
||||
_stats[to_id][from_id] = {
|
||||
user_id = from_id,
|
||||
name = user_name,
|
||||
@ -43,10 +43,10 @@ function read_file_stats( )
|
||||
-- If file doesn't exists
|
||||
if f == nil then
|
||||
-- Create a new empty table
|
||||
print ('Created user stats file '.._file_stats)
|
||||
print ('"user stats file" erstellt '.._file_stats)
|
||||
serialize_to_file({}, _file_stats)
|
||||
else
|
||||
print ('Stats loaded: '.._file_stats)
|
||||
print ('Stats geladen: '.._file_stats)
|
||||
f:close()
|
||||
end
|
||||
return loadfile (_file_stats)()
|
||||
@ -95,7 +95,7 @@ local function run(msg, matches)
|
||||
if msg.to.type == 'chat' or is_sudo(msg) then
|
||||
return get_stats_status(msg)
|
||||
else
|
||||
return 'Stats works only chats'
|
||||
return 'Stats funktioniert nur in Chats'
|
||||
end
|
||||
else
|
||||
update_user_stats(msg)
|
||||
|
@ -69,7 +69,7 @@ end
|
||||
|
||||
return {
|
||||
description = "Steam-Info",
|
||||
usage = "",
|
||||
usage = {"store.steampowered.com/app Link","steamcommunity.com/app Link"},
|
||||
patterns = {
|
||||
"store.steampowered.com/app/([0-9]+)",
|
||||
"steamcommunity.com/app/([0-9]+)"
|
||||
|
@ -27,7 +27,7 @@ local function send_generics_from_url_callback(cb_extra, success, result)
|
||||
-- The previously image to remove
|
||||
if remove_path ~= nil then
|
||||
os.remove(remove_path)
|
||||
print("Deleted: "..remove_path)
|
||||
print("Gelöscht: "..remove_path)
|
||||
end
|
||||
|
||||
-- Nil or empty, exit case (no more urls)
|
||||
@ -110,23 +110,23 @@ end
|
||||
|
||||
local function check_keys()
|
||||
if consumer_key:isempty() then
|
||||
return "Twitter Consumer Key is empty, write it in plugins/twitter.lua"
|
||||
return "Twitter Consumer Key ist nicht vorhanden, schreibe ihn in data/credentials.lua"
|
||||
end
|
||||
if consumer_secret:isempty() then
|
||||
return "Twitter Consumer Secret is empty, write it in plugins/twitter.lua"
|
||||
return "Twitter Consumer Secret ist nicht vorhanden, schreibe ihn in data/credentials.lua"
|
||||
end
|
||||
if access_token:isempty() then
|
||||
return "Twitter Access Token is empty, write it in plugins/twitter.lua"
|
||||
return "Twitter Access Token ist nicht vorhanden, schreibe ihn in data/credentials.lua"
|
||||
end
|
||||
if access_token_secret:isempty() then
|
||||
return "Twitter Access Token Secret is empty, write it in plugins/twitter.lua"
|
||||
return "Twitter Access Token Secret ist nicht vorhanden, schreibe ihn in data/credentials.lua"
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
|
||||
local function analyze_tweet(tweet)
|
||||
local header = "Tweet from " .. tweet.user.name .. " (@" .. tweet.user.screen_name .. ")\n" -- "Link: https://twitter.com/statuses/" .. tweet.id_str
|
||||
local header = "Tweet von " .. tweet.user.name .. " (@" .. tweet.user.screen_name .. ")\n" -- "Link: https://twitter.com/statuses/" .. tweet.id_str
|
||||
local text = tweet.text
|
||||
|
||||
-- replace short URLs
|
||||
@ -170,12 +170,12 @@ local function getTweet(msg, base, all)
|
||||
local response_code, response_headers, response_status_line, response_body = client:PerformRequest("GET", twitter_url, base)
|
||||
|
||||
if response_code ~= 200 then
|
||||
return "Can't connect, maybe the user don't exist."
|
||||
return "Dieser User scheint nicht zu existieren."
|
||||
end
|
||||
|
||||
local response = json:decode(response_body)
|
||||
if #response == 0 then
|
||||
return "Can't retrieve any tweet, sorry"
|
||||
return "Konnte keine Tweets finden"
|
||||
end
|
||||
if all then
|
||||
for i,tweet in pairs(response) do
|
||||
@ -214,7 +214,7 @@ local function run(msg, matches)
|
||||
if #matches == 4 then
|
||||
local n = tonumber(matches[4])
|
||||
if n > 10 then
|
||||
return "You only can ask for 10 tweets at most"
|
||||
return "Nicht so schnell bitte"
|
||||
end
|
||||
count = matches[4]
|
||||
all = true
|
||||
|
@ -15,18 +15,17 @@ local client = OAuth.new(consumer_key, consumer_secret, {
|
||||
})
|
||||
|
||||
function run(msg, matches)
|
||||
|
||||
if consumer_key:isempty() then
|
||||
return "Twitter Consumer Key is empty, write it in plugins/twitter.lua"
|
||||
return "Twitter Consumer Key ist nicht vorhanden, schreibe ihn in data/credentials.lua"
|
||||
end
|
||||
if consumer_secret:isempty() then
|
||||
return "Twitter Consumer Secret is empty, write it in plugins/twitter.lua"
|
||||
return "Twitter Consumer Secret ist nicht vorhanden, schreibe ihn in data/credentials.lua"
|
||||
end
|
||||
if access_token:isempty() then
|
||||
return "Twitter Access Token is empty, write it in plugins/twitter.lua"
|
||||
return "Twitter Access Token ist nicht vorhanden, schreibe ihn in data/credentials.lua"
|
||||
end
|
||||
if access_token_secret:isempty() then
|
||||
return "Twitter Access Token Secret is empty, write it in plugins/twitter.lua"
|
||||
return "Twitter Access Token Secret ist nicht vorhanden, schreibe ihn in data/credentials.lua"
|
||||
end
|
||||
|
||||
local twitter_url = "https://api.twitter.com/1.1/statuses/show/" .. matches[1] .. ".json"
|
||||
@ -69,8 +68,8 @@ function run(msg, matches)
|
||||
end
|
||||
|
||||
return {
|
||||
description = "When user sends twitter URL, send text and images to origin. Requieres OAuth Key.",
|
||||
usage = "",
|
||||
description = "Wenn ein Twitter Link gesendet wird, wird der Tweet gepostet",
|
||||
usage = {"twitter.com Link"},
|
||||
patterns = {"https://twitter.com/[^/]+/status/([0-9]+)"},
|
||||
run = run
|
||||
}
|
||||
|
@ -18,16 +18,16 @@ local client = OAuth.new(consumer_key, consumer_secret, {
|
||||
|
||||
function run(msg, matches)
|
||||
if consumer_key:isempty() then
|
||||
return "Twitter Consumer Key is empty, write it in plugins/twitter_send.lua"
|
||||
return "Twitter Consumer Key ist nicht vorhanden, schreibe ihn in data/credentials.lua"
|
||||
end
|
||||
if consumer_secret:isempty() then
|
||||
return "Twitter Consumer Secret is empty, write it in plugins/twitter_send.lua"
|
||||
return "Twitter Consumer Secret ist nicht vorhanden, schreibe ihn in data/credentials.lua"
|
||||
end
|
||||
if access_token:isempty() then
|
||||
return "Twitter Access Token is empty, write it in plugins/twitter_send.lua"
|
||||
return "Twitter Access Token ist nicht vorhanden, schreibe ihn in data/credentials.lua"
|
||||
end
|
||||
if access_token_secret:isempty() then
|
||||
return "Twitter Access Token Secret is empty, write it in plugins/twitter_send.lua"
|
||||
return "Twitter Access Token Secret ist nicht vorhanden, schreibe ihn in data/credentials.lua"
|
||||
end
|
||||
|
||||
local response_code, response_headers, response_status_line, response_body =
|
||||
@ -42,8 +42,8 @@ function run(msg, matches)
|
||||
end
|
||||
|
||||
return {
|
||||
description = "",
|
||||
usage = "",
|
||||
description = "Sende Tweets auf Twitter! twitter.com/Mikubot_",
|
||||
usage = {"/tw [Text]"},
|
||||
patterns = {"^/tw (.+)"},
|
||||
run = run,
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
do
|
||||
|
||||
function getWallpaper(text)
|
||||
|
@ -1,12 +1,12 @@
|
||||
function run(msg, matches)
|
||||
local user_name = get_name(msg)
|
||||
return "" .. user_name .. " ist wieder da"
|
||||
return user_name .. " ist wieder da"
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Sagt dass ihr wieder da seid",
|
||||
usage = {"/wd"},
|
||||
patterns = {"^/wd(.*)$"},
|
||||
patterns = {"^/wd$"},
|
||||
run = run
|
||||
}
|
||||
--by Akamaru
|
@ -33,7 +33,7 @@ end
|
||||
|
||||
return {
|
||||
description = "Sendet YouTube-Info.",
|
||||
usage = "",
|
||||
usage = {"youtube.com/watch Link","youtu.be Link"},
|
||||
patterns = {
|
||||
"youtu.be/([A-Za-z0-9-_-]+)",
|
||||
"youtube.com/watch%?v=([A-Za-z0-9-_-]+)",
|
||||
|
Reference in New Issue
Block a user