From 0c97b53d581f79d31d8062705c9dfac7de63f741 Mon Sep 17 00:00:00 2001 From: Akamaru Date: Tue, 12 May 2015 20:15:15 +0200 Subject: [PATCH] more german translation and optimizations --- bot/bot.lua | 50 ++++++++++++--------------------------- plugins/afk.lua | 3 +-- plugins/channels.lua | 2 +- plugins/date.lua | 2 +- plugins/dmm.lua | 9 +++---- plugins/facepalm.lua | 2 +- plugins/get.lua | 11 ++++----- plugins/invite.lua | 7 ++---- plugins/isup.lua | 16 ++++++------- plugins/media.lua | 12 +++++----- plugins/minecraft.lua | 6 ++--- plugins/naira_derp.lua | 4 ++-- plugins/nau.lua | 4 ++-- plugins/plugins.lua | 22 ++++++++--------- plugins/quotes.lua | 2 +- plugins/reload.lua | 4 ++-- plugins/sakurasou.lua | 2 +- plugins/senran_kagura.lua | 2 +- plugins/set.lua | 2 +- plugins/sh.lua | 2 +- plugins/stats.lua | 12 +++++----- plugins/steam.lua | 2 +- plugins/tweet.lua | 32 ++++++++++++------------- plugins/twitter.lua | 13 +++++----- plugins/twitter_send.lua | 12 +++++----- plugins/wallpaper.lua | 1 - plugins/wd.lua | 4 ++-- plugins/youtube.lua | 2 +- 28 files changed, 105 insertions(+), 137 deletions(-) diff --git a/bot/bot.lua b/bot/bot.lua index a9cfb44..04f6094 100644 --- a/bot/bot.lua +++ b/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 diff --git a/plugins/afk.lua b/plugins/afk.lua index fd9f524..544edec 100644 --- a/plugins/afk.lua +++ b/plugins/afk.lua @@ -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 { diff --git a/plugins/channels.lua b/plugins/channels.lua index 30fdb13..a22603c 100644 --- a/plugins/channels.lua +++ b/plugins/channels.lua @@ -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, diff --git a/plugins/date.lua b/plugins/date.lua index 539b374..cb3b954 100644 --- a/plugins/date.lua +++ b/plugins/date.lua @@ -5,7 +5,7 @@ end return { description = "Zeigt das aktuelle Datum an", - usage = "/date", + usage = {"/date"}, patterns = {"^/date$"}, run = run } diff --git a/plugins/dmm.lua b/plugins/dmm.lua index 81862f2..2fbf7ab 100644 --- a/plugins/dmm.lua +++ b/plugins/dmm.lua @@ -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 } diff --git a/plugins/facepalm.lua b/plugins/facepalm.lua index b41d654..a03eb77 100644 --- a/plugins/facepalm.lua +++ b/plugins/facepalm.lua @@ -1,5 +1,5 @@ function run(msg, matches) - send_document(get_receiver(msg), "sticker/facepalm.webp", ok_cb, false) + send_document(get_receiver(msg), "sticker/facepalm.webp", ok_cb, false) end return { diff --git a/plugins/get.lua b/plugins/get.lua index 82e6e57..db306cc 100644 --- a/plugins/get.lua +++ b/plugins/get.lua @@ -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 } diff --git a/plugins/invite.lua b/plugins/invite.lua index 673f3c8..48f2008 100644 --- a/plugins/invite.lua +++ b/plugins/invite.lua @@ -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 } diff --git a/plugins/isup.lua b/plugins/isup.lua index 587637c..598ef1d 100644 --- a/plugins/isup.lua +++ b/plugins/isup.lua @@ -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) (.*)$", diff --git a/plugins/media.lua b/plugins/media.lua index 7a98745..d89f18f 100644 --- a/plugins/media.lua +++ b/plugins/media.lua @@ -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 diff --git a/plugins/minecraft.lua b/plugins/minecraft.lua index d2c009f..cdc1a25 100644 --- a/plugins/minecraft.lua +++ b/plugins/minecraft.lua @@ -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 } \ No newline at end of file diff --git a/plugins/naira_derp.lua b/plugins/naira_derp.lua index 4d91115..0bf17c9 100644 --- a/plugins/naira_derp.lua +++ b/plugins/naira_derp.lua @@ -1,11 +1,11 @@ function run(msg, matches) - send_document(get_receiver(msg), "sticker/naira_derp.webp", ok_cb, false) + send_document(get_receiver(msg), "sticker/naira_derp.webp", ok_cb, false) end return { description = "Naira Derp", usage = {"/nairad","/Nairad"}, - patterns = {"^/nairad","^/Nairad"}, + patterns = {"^/nairad$","^/Nairad$"}, run = run } --by Akamaru \ No newline at end of file diff --git a/plugins/nau.lua b/plugins/nau.lua index efc4f16..51a8257 100644 --- a/plugins/nau.lua +++ b/plugins/nau.lua @@ -4,8 +4,8 @@ end return { description = "RTL Nau", - usage = {"/nau"}, - patterns = {"^/nau"}, + usage = {"/nau","/now"}, + patterns = {"^/nau$","^/now$"}, run = run } --by Akamaru \ No newline at end of file diff --git a/plugins/plugins.lua b/plugins/plugins.lua index 78f71f4..9b6e9fa 100644 --- a/plugins/plugins.lua +++ b/plugins/plugins.lua @@ -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 diff --git a/plugins/quotes.lua b/plugins/quotes.lua index 0243200..d919c9d 100644 --- a/plugins/quotes.lua +++ b/plugins/quotes.lua @@ -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 diff --git a/plugins/reload.lua b/plugins/reload.lua index 909bd01..a35ad62 100644 --- a/plugins/reload.lua +++ b/plugins/reload.lua @@ -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 diff --git a/plugins/sakurasou.lua b/plugins/sakurasou.lua index ff81796..dee4e57 100644 --- a/plugins/sakurasou.lua +++ b/plugins/sakurasou.lua @@ -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 diff --git a/plugins/senran_kagura.lua b/plugins/senran_kagura.lua index 8003249..5050f2f 100644 --- a/plugins/senran_kagura.lua +++ b/plugins/senran_kagura.lua @@ -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 diff --git a/plugins/set.lua b/plugins/set.lua index 86fb143..7887c68 100644 --- a/plugins/set.lua +++ b/plugins/set.lua @@ -24,7 +24,7 @@ end return { description = "Setze Variable", - usage = "/set [Variablenname] [Daten]", + usage = {"/set [Variablenname] [Daten]"}, patterns = {"^/set (%a+) (.+)$"}, run = run } \ No newline at end of file diff --git a/plugins/sh.lua b/plugins/sh.lua index 2299e16..1e2e773 100644 --- a/plugins/sh.lua +++ b/plugins/sh.lua @@ -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 diff --git a/plugins/stats.lua b/plugins/stats.lua index 394d3bc..20cb8a7 100644 --- a/plugins/stats.lua +++ b/plugins/stats.lua @@ -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) diff --git a/plugins/steam.lua b/plugins/steam.lua index 6bc63dc..d04408e 100644 --- a/plugins/steam.lua +++ b/plugins/steam.lua @@ -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]+)" diff --git a/plugins/tweet.lua b/plugins/tweet.lua index 1952ff8..4b790bc 100644 --- a/plugins/tweet.lua +++ b/plugins/tweet.lua @@ -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" - end - if consumer_secret:isempty() then - return "Twitter Consumer Secret is empty, write it in plugins/twitter.lua" - end - if access_token:isempty() then - return "Twitter Access Token is empty, write it in plugins/twitter.lua" - end - if access_token_secret:isempty() then - return "Twitter Access Token Secret is empty, write it in plugins/twitter.lua" - end + return "Twitter Consumer Key ist nicht vorhanden, schreibe ihn in data/credentials.lua" + end + if consumer_secret:isempty() then + return "Twitter Consumer Secret ist nicht vorhanden, schreibe ihn in data/credentials.lua" + end + if access_token:isempty() then + 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 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 diff --git a/plugins/twitter.lua b/plugins/twitter.lua index 72baaa2..f75e737 100644 --- a/plugins/twitter.lua +++ b/plugins/twitter.lua @@ -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 } diff --git a/plugins/twitter_send.lua b/plugins/twitter_send.lua index 26f8a8f..b81f9cb 100644 --- a/plugins/twitter_send.lua +++ b/plugins/twitter_send.lua @@ -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, } diff --git a/plugins/wallpaper.lua b/plugins/wallpaper.lua index e569dc2..2e05b0b 100644 --- a/plugins/wallpaper.lua +++ b/plugins/wallpaper.lua @@ -1,4 +1,3 @@ - do function getWallpaper(text) diff --git a/plugins/wd.lua b/plugins/wd.lua index 4b5d6c6..2b2ec4b 100644 --- a/plugins/wd.lua +++ b/plugins/wd.lua @@ -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 \ No newline at end of file diff --git a/plugins/youtube.lua b/plugins/youtube.lua index f33c3c1..6787fe8 100644 --- a/plugins/youtube.lua +++ b/plugins/youtube.lua @@ -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-_-]+)",