many code cleanup in plugins

This commit is contained in:
Akamaru 2015-04-20 18:52:25 +02:00
parent 1c93a20e11
commit 4021a1c84d
39 changed files with 133 additions and 150 deletions

View File

@ -1,13 +1,13 @@
function run(msg, matches) function run(msg, matches)
--get username
local user_name = get_name(msg) local user_name = get_name(msg)
return "" .. user_name .. " ist nun AFK" return '' .. user_name .. ' ist nun AFK'
end end
return { return {
description = "Sagt dass ihr afk seid", description = "Sagt dass ihr afk seid",
usage = "/afk", usage = "/afk",
patterns = { patterns = {"^/afk(.*)$"},
"^/afk(.*)$"
},
run = run run = run
} }
--by Akamaru

View File

@ -1,8 +1,5 @@
function run(msg, matches) function run(msg, matches)
send_photo(get_receiver(msg), "pictures/aha.png", ok_cb, false)
if string.starts(msg.text, "aha.png") then
send_photo(get_receiver(msg), "pictures/aha.png", ok_cb, false)
end
end end
return { return {
@ -10,4 +7,5 @@ return {
usage = "aha.png", usage = "aha.png",
patterns = {"^aha.png"}, patterns = {"^aha.png"},
run = run run = run
} }
--by Akamaru

View File

@ -1,11 +1,11 @@
function run(msg, matches) function run(msg, matches)
return "Gomen'nasai 😣" return "Gomen'nasai 😣"
end end
return { return {
description = "", description = "So ein dummer Bot",
usage = "", usage = "Baka Bot",
patterns = {"^baka bot", patterns = {"^baka bot",
"Baka bot", "Baka bot",
"baka Bot", "baka Bot",
@ -13,3 +13,4 @@ return {
"BAKA BOT"}, "BAKA BOT"},
run = run run = run
} }
--by Akamaru

View File

@ -1,15 +1,13 @@
function run(msg, matches) function run(msg, matches)
send_photo(get_receiver(msg), "pictures/luckystar/barusamikosu.jpg", ok_cb, false)
if string.starts(msg.text, '/barusamiko') or string.starts(msg.text, "/barusamikosu") or string.starts(msg.text, "/Balsamiko Essig") then
send_photo(get_receiver(msg), "pictures/luckystar/barusamikosu.jpg", ok_cb, false)
end
end end
return { return {
description = "Balsamiko Essig!", description = "Balsamiko Essig!",
usage = "/barusamiko", usage = "/barusamiko",
patterns = {"^/barusamiko", patterns = {"^/barusamiko",
"^/barusamikosu", "^/barusamikosu",
"^/Balsamiko Essig"}, "^/Balsamiko Essig"},
run = run run = run
} }
--by Akamaru

View File

@ -16,7 +16,7 @@ function cron()
end end
return { return {
description = "", description = "Checkt ob Boerse.to online ist",
usage = "", usage = "",
patterns = {}, patterns = {},
run = nil, run = nil,

View File

@ -14,7 +14,7 @@ function run(msg, matches)
end end
return { return {
description = "get chuck norris joke", description = "Sendet Chuck Norris Witze (Englisch)",
usage = "/cn", usage = "/cn",
patterns = {"^/cn$"}, patterns = {"^/cn$"},
run = run run = run

View File

@ -1,14 +1,13 @@
function run(msg, matches) function run(msg, matches)
if matches[1] == "/emoticons" then return '😄😃😀😊☺😉😍😘😚😗😙😜😝😛😳😁😔😌😒😞😣😢😂😭😪😥😰😅😓😩😫😨😱😠😡😤😖😆😋😷😎😴😵😲😟😦😧😈👿😮😬😐😕😯😶😇😏😑👲👳👮👷💂👶👦👧👨👩👴👵👱👼👸😺😸😻😽😼🙀😿😹😾👹👺🙈🙉🙊💀👽💩🔥✨🌟💫💥💢💦💧💤💨👂👀👃👅👄👍👎👌👊✊✌👋✋👐👆👇👉👈🙌🙏☝👏💪🚶🏃💃👫👪👬👭💏💑👯🙆🙅💁🙋💆💇💅👰🙎🙍🙇🎩👑👒👟👞👡👠👢👕👔👚👗🎽👖👘👙💼👜👝👛👓🎀🌂💄💛💙💜💚❤💔💗💓💕💖💞💘💌💋💍💎👤👥💬👣💭🐶🐺🐱🐭🐹🐰🐸🐯🐨🐻🐷🐽🐮🐗🐵🐒🐴🐑🐘🐼🐧🐦🐤🐥🐣🐔🐍🐢🐛🐝🐜🐞🐌🐙🐚🐠🐟🐬🐳🐋🐄🐏🐀🐃🐅🐇🐉🐎🐐🐓🐕🐖🐁🐂🐲🐡🐊🐫🐪🐆🐈🐩🐾💐🌸🌷🍀🌹🌻🌺🍁🍃🍂🌿🌾🍄🌵🌴🌲🌳🌰🌱🌼🌐🌞🌝🌚🌑🌒🌓🌔🌕🌖🌗🌘🌜🌛🌙🌍🌎🌏🌋🌌🌠⭐🌀🌁🌈🌊🎍💝🎎🎒🎓🎏🎆🎇🎐🎑🎃👻🎅🎄🎁🎋🎉🎊🎈🎌🔮🎥📷📹📼💿📀💽💾💻📱☎📞📟📠📡📺📻🔊🔉🔈🔇🔔🔕📢📣⏳⌛⏰⌚🔓🔒🔏🔐🔑🔎💡🔦🔆🔅🔌🔋🔍🛁🛀🚿🚽🔧🔩🔨🚪🚬💣🔫🔪💊💉💰💴💵💷💶💳💸📲📧📥📤✉📩📨📯📫📪📬📭📮📦📝📄📃📑📊📈📉📜📋📅📆📇📁📂✂📌📎✒📏📐📕📗📘📙📓📔📒📚📖🔖📛🔬🔭📰🎨🎬🎤🎧🎼🎵🎶🎹🎻🎺🎷🎸👾🎮🃏🎴🀄🎲🎯🏈🏀⚽🎾🎱🏉🎳⛳🚵🚴🏁🏇🏆🎿🏂🏊🏄🎣☕🍵🍶🍼🍺🍻🍸🍹🍷🍴🍕🍔🍟🍗🍖🍝🍛🍤🍱🍣🍥🍙🍘🍚🍜🍲🍢🍡🍳🍞🍩🍮🍦🍨🍧🎂🍰🍪🍫🍬🍭🍯🍎🍏🍊🍋🍒🍇🍉🍓🍑🍈🍌🍐🍍🍠🍆🍅🌽🏠🏡🏫🏢🏣🏥🏦🏪🏩🏨💒⛪🏬🏤🌇🌆🏯🏰⛺🏭🗼🗾🗻🌄🌅🌃🗽🌉🎠🎡⛲🎢🚢⛵🚤🚣⚓🚀✈💺🚁🚂🚊🚉🚞🚆🚄🚅🚈🚇🚝🚋🚃🚎🚌🚍🚙🚘🚗🚕🚖🚛🚚🚨🚓🚔🚒🚑🚐🚲🚡🚟🚠🚜💈🚏🎫🚦🚥⚠🚧🔰⛽🏮🎰♨🗿🎪🎭📍🚩🇯🇵🇰🇷🇩🇪🇨🇳🇺🇸🇫🇷🇪🇸🇮🇹🇷🇺🇬🇧1⃣2⃣3⃣4⃣5⃣6⃣7⃣8⃣9⃣0⃣🔟🔢#⃣🔣⬆️⬇️⬅️➡️🔠🔡🔤↗️↖️↘️↙️↔️↕️🔄◀️▶️🔼🔽↩️↪️ℹ️⏪⏩⏫⏬⤵️⤴️🆗🔀🔁🔂🆕🆙🆒🆓🆖📶🎦🈁🈯️🈳🈵🈴🈲🉐🈹🈺🈶🈚️🚻🚹🚺🚼🚾🚰🚮🅿️♿️🚭🈷🈸🈂Ⓜ️🛂🛄🛅🛃🉑㊙️㊗️🆑🆘🆔🚫🔞📵🚯🚱🚳🚷🚸⛔️✳️❇️❎✅✴️💟🆚📳📴🅰🅱🆎🅾💠➿♻️♈️♉️♊️♋️♌️♍️♎️♏️♐️♑️♒️♓️⛎🔯🏧💹💲💱©®™❌‼️⁉️❗️❓❕❔⭕️🔝🔚🔙🔛🔜🔃🕛🕧🕐🕜🕑🕝🕒🕞🕓🕟🕔🕠🕕🕖🕗🕘🕙🕚🕡🕢🕣🕤🕥🕦✖️➕➖➗♠️♥️♣️♦️💮💯✔️☑️🔘🔗➰〰〽️🔱◼️◻️◾️◽️▪️▫️🔺🔲🔳⚫️⚪️🔴🔵🔻⬜️⬛️🔶🔷🔸🔹'
return '😄😃😀😊☺😉😍😘😚😗😙😜😝😛😳😁😔😌😒😞😣😢😂😭😪😥😰😅😓😩😫😨😱😠😡😤😖😆😋😷😎😴😵😲😟😦😧😈👿😮😬😐😕😯😶😇😏😑👲👳👮👷💂👶👦👧👨👩👴👵👱👼👸😺😸😻😽😼🙀😿😹😾👹👺🙈🙉🙊💀👽💩🔥✨🌟💫💥💢💦💧💤💨👂👀👃👅👄👍👎👌👊✊✌👋✋👐👆👇👉👈🙌🙏☝👏💪🚶🏃💃👫👪👬👭💏💑👯🙆🙅💁🙋💆💇💅👰🙎🙍🙇🎩👑👒👟👞👡👠👢👕👔👚👗🎽👖👘👙💼👜👝👛👓🎀🌂💄💛💙💜💚❤💔💗💓💕💖💞💘💌💋💍💎👤👥💬👣💭🐶🐺🐱🐭🐹🐰🐸🐯🐨🐻🐷🐽🐮🐗🐵🐒🐴🐑🐘🐼🐧🐦🐤🐥🐣🐔🐍🐢🐛🐝🐜🐞🐌🐙🐚🐠🐟🐬🐳🐋🐄🐏🐀🐃🐅🐇🐉🐎🐐🐓🐕🐖🐁🐂🐲🐡🐊🐫🐪🐆🐈🐩🐾💐🌸🌷🍀🌹🌻🌺🍁🍃🍂🌿🌾🍄🌵🌴🌲🌳🌰🌱🌼🌐🌞🌝🌚🌑🌒🌓🌔🌕🌖🌗🌘🌜🌛🌙🌍🌎🌏🌋🌌🌠⭐🌀🌁🌈🌊🎍💝🎎🎒🎓🎏🎆🎇🎐🎑🎃👻🎅🎄🎁🎋🎉🎊🎈🎌🔮🎥📷📹📼💿📀💽💾💻📱☎📞📟📠📡📺📻🔊🔉🔈🔇🔔🔕📢📣⏳⌛⏰⌚🔓🔒🔏🔐🔑🔎💡🔦🔆🔅🔌🔋🔍🛁🛀🚿🚽🔧🔩🔨🚪🚬💣🔫🔪💊💉💰💴💵💷💶💳💸📲📧📥📤✉📩📨📯📫📪📬📭📮📦📝📄📃📑📊📈📉📜📋📅📆📇📁📂✂📌📎✒📏📐📕📗📘📙📓📔📒📚📖🔖📛🔬🔭📰🎨🎬🎤🎧🎼🎵🎶🎹🎻🎺🎷🎸👾🎮🃏🎴🀄🎲🎯🏈🏀⚽🎾🎱🏉🎳⛳🚵🚴🏁🏇🏆🎿🏂🏊🏄🎣☕🍵🍶🍼🍺🍻🍸🍹🍷🍴🍕🍔🍟🍗🍖🍝🍛🍤🍱🍣🍥🍙🍘🍚🍜🍲🍢🍡🍳🍞🍩🍮🍦🍨🍧🎂🍰🍪🍫🍬🍭🍯🍎🍏🍊🍋🍒🍇🍉🍓🍑🍈🍌🍐🍍🍠🍆🍅🌽🏠🏡🏫🏢🏣🏥🏦🏪🏩🏨💒⛪🏬🏤🌇🌆🏯🏰⛺🏭🗼🗾🗻🌄🌅🌃🗽🌉🎠🎡⛲🎢🚢⛵🚤🚣⚓🚀✈💺🚁🚂🚊🚉🚞🚆🚄🚅🚈🚇🚝🚋🚃🚎🚌🚍🚙🚘🚗🚕🚖🚛🚚🚨🚓🚔🚒🚑🚐🚲🚡🚟🚠🚜💈🚏🎫🚦🚥⚠🚧🔰⛽🏮🎰♨🗿🎪🎭📍🚩🇯🇵🇰🇷🇩🇪🇨🇳🇺🇸🇫🇷🇪🇸🇮🇹🇷🇺🇬🇧1⃣2⃣3⃣4⃣5⃣6⃣7⃣8⃣9⃣0⃣🔟🔢#⃣🔣⬆️⬇️⬅️➡️🔠🔡🔤↗️↖️↘️↙️↔️↕️🔄◀️▶️🔼🔽↩️↪️ℹ️⏪⏩⏫⏬⤵️⤴️🆗🔀🔁🔂🆕🆙🆒🆓🆖📶🎦🈁🈯️🈳🈵🈴🈲🉐🈹🈺🈶🈚️🚻🚹🚺🚼🚾🚰🚮🅿️♿️🚭🈷🈸🈂Ⓜ️🛂🛄🛅🛃🉑㊙️㊗️🆑🆘🆔🚫🔞📵🚯🚱🚳🚷🚸⛔️✳️❇️❎✅✴️💟🆚📳📴🅰🅱🆎🅾💠➿♻️♈️♉️♊️♋️♌️♍️♎️♏️♐️♑️♒️♓️⛎🔯🏧💹💲💱©®™❌‼️⁉️❗️❓❕❔⭕️🔝🔚🔙🔛🔜🔃🕛🕧🕐🕜🕑🕝🕒🕞🕓🕟🕔🕠🕕🕖🕗🕘🕙🕚🕡🕢🕣🕤🕥🕦✖️➕➖➗♠️♥️♣️♦️💮💯✔️☑️🔘🔗➰〰〽️🔱◼️◻️◾️◽️▪️▫️🔺🔲🔳⚫️⚪️🔴🔵🔻⬜️⬛️🔶🔷🔸🔹'
end
end end
return { return {
description = "Sendet alle Emoticons", description = "Sendet alle Emoticons",
usage = "/emoticons", usage = "/emoticons",
patterns = {"^/emoticons"}, patterns = {"^/emoticons",
"^/Emoticons"},
run = run run = run
} }
--by Akamaru

View File

@ -8,4 +8,5 @@ return {
patterns = {"^/facepalm", patterns = {"^/facepalm",
"^/Facepalm"}, "^/Facepalm"},
run = run run = run
} }
--by Akamaru

View File

@ -1,7 +1,7 @@
function run(msg, matches) function run(msg, matches)
local user_name = get_name(msg) local user_name = get_name(msg)
local receiver = get_receiver(msg) local receiver = get_receiver(msg)
return "Hallo " .. user_name .. "!" return "Hallo " .. user_name .. "!"
end end
return { return {
@ -13,3 +13,4 @@ return {
}, },
run = run run = run
} }
--by Akamaru

View File

@ -7,8 +7,8 @@ function run(msg, matches)
end end
return { return {
description = "When user sends image URL (ends with png, jpg, jpeg) download and send it to origin.", description = "Wenn ein Link zu einem Bild gesendet wird, läd und sendet der Bot das Bild.",
usage = "", usage = "Link zum Bild",
patterns = { patterns = {
"(https?://[%w-_%.%?%.:/%+=&]+%.png)$", "(https?://[%w-_%.%?%.:/%+=&]+%.png)$",
"(https?://[%w-_%.%?%.:/%+=&]+%.jpg)$", "(https?://[%w-_%.%?%.:/%+=&]+%.jpg)$",

View File

@ -1,6 +1,6 @@
do do
function getGoogleImage(text) function getGoogleImage2(text)
local text = URL.escape(text) local text = URL.escape(text)
local api = "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=8&q=" local api = "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=8&q="
local res, code = http.request(api..text) local res, code = http.request(api..text)
@ -29,7 +29,7 @@ end
function run(msg, matches) function run(msg, matches)
local receiver = get_receiver(msg) local receiver = get_receiver(msg)
local text = matches[1] local text = matches[1]
local url = getGoogleImage(text) local url = getGoogleImage2(text)
if not url then if not url then
return "Kein Bild gefunden." return "Kein Bild gefunden."

View File

@ -1,19 +1,18 @@
function run(msg, matches) function run(msg, matches)
randomValue = math.random(6) randomValue = math.random(6)
if randomValue == 1 then if randomValue == 1 then
send_photo(get_receiver(msg), "pictures/justkitten/justkitten1.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/justkitten/justkitten1.jpg", ok_cb, false)
elseif randomValue == 2 then elseif randomValue == 2 then
send_photo(get_receiver(msg), "pictures/justkitten/justkitten2.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/justkitten/justkitten2.jpg", ok_cb, false)
elseif randomValue == 3 then elseif randomValue == 3 then
send_photo(get_receiver(msg), "pictures/justkitten/justkitten3.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/justkitten/justkitten3.jpg", ok_cb, false)
elseif randomValue == 4 then elseif randomValue == 4 then
send_photo(get_receiver(msg), "pictures/justkitten/justkitten4.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/justkitten/justkitten4.jpg", ok_cb, false)
elseif randomValue == 5 then elseif randomValue == 5 then
send_photo(get_receiver(msg), "pictures/justkitten/justkitten5.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/justkitten/justkitten5.jpg", ok_cb, false)
elseif randomValue == 6 then elseif randomValue == 6 then
send_photo(get_receiver(msg), "pictures/justkitten/justkitten6.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/justkitten/justkitten6.jpg", ok_cb, false)
end end
end end
return { return {
@ -21,4 +20,5 @@ return {
usage = "/jk", usage = "/jk",
patterns = {"^/jk"}, patterns = {"^/jk"},
run = run run = run
} }
--by Akamaru

View File

@ -1,15 +1,14 @@
function run(msg, matches) function run(msg, matches)
randomValue = math.random(4) randomValue = math.random(4)
if randomValue == 1 then if randomValue == 1 then
send_photo(get_receiver(msg), "pictures/cats/cat1.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/cats/cat1.jpg", ok_cb, false)
elseif randomValue == 2 then elseif randomValue == 2 then
send_photo(get_receiver(msg), "pictures/cats/cat2.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/cats/cat2.jpg", ok_cb, false)
elseif randomValue == 3 then elseif randomValue == 3 then
send_photo(get_receiver(msg), "pictures/cats/cat3.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/cats/cat3.jpg", ok_cb, false)
elseif randomValue == 4 then elseif randomValue == 4 then
send_photo(get_receiver(msg), "pictures/cats/cat4.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/cats/cat4.jpg", ok_cb, false)
end end
end end
return { return {
@ -17,4 +16,5 @@ return {
usage = "/kitty", usage = "/kitty",
patterns = {"^/kitty"}, patterns = {"^/kitty"},
run = run run = run
} }
--by Akamaru

View File

@ -29,4 +29,5 @@ return {
"^/tsukasa", "^/tsukasa",
"^/Tsukasa"}, "^/Tsukasa"},
run = run run = run
} }
--by Akamaru

View File

@ -31,7 +31,7 @@ end
function run(msg, matches) function run(msg, matches)
local lyrics = getLyrics(msg.text) local lyrics = getLyrics(msg.text)
if (lyrics == nil) then if (lyrics == nil) then
return "Zzzzz..." return "Nichts gefunden!"
else else
return lyrics return lyrics
end end

View File

@ -17,4 +17,5 @@ return {
}, },
run = run run = run
} }
end end
--by Akamaru

View File

@ -7,8 +7,8 @@ function run(msg, matches)
end end
return { return {
description = "When user sends media URL (ends with gif, mp4, pdf, etc.) download and send it to origin.", description = "Wenn ein Link zu einer Datei gesendet wird, läd und sendet der Bot die Datei.",
usage = "", usage = "Link zur Datei",
patterns = { patterns = {
"(https?://[%w-_%.%?%.:/%+=&]+%.gif)$", "(https?://[%w-_%.%?%.:/%+=&]+%.gif)$",
"(https?://[%w-_%.%?%.:/%+=&]+%.mp4)$", "(https?://[%w-_%.%?%.:/%+=&]+%.mp4)$",

View File

@ -1,7 +1,7 @@
function run(msg, matches) function run(msg, matches)
return 'se' return 'se'
end end
return { return {
description = "Möpse? Meepse?", description = "Möpse? Meepse?",
@ -12,4 +12,4 @@ return {
"Meep"}, "Meep"},
run = run run = run
} }
--by Akamaru

View File

@ -8,4 +8,5 @@ return {
patterns = {"^/nairad", patterns = {"^/nairad",
"^/Nairad"}, "^/Nairad"},
run = run run = run
} }
--by Akamaru

View File

@ -1,8 +1,5 @@
function run(msg, matches) function run(msg, matches)
send_photo(get_receiver(msg), "pictures/nau.jpg", ok_cb, false)
if string.starts(msg.text, "/nau") then
send_photo(get_receiver(msg), "pictures/nau.jpg", ok_cb, false)
end
end end
return { return {
@ -10,4 +7,5 @@ return {
usage = "/nau", usage = "/nau",
patterns = {"^/nau"}, patterns = {"^/nau"},
run = run run = run
} }
--by Akamaru

View File

@ -1,8 +1,5 @@
function run(msg, matches) function run(msg, matches)
send_photo(get_receiver(msg), "pictures/neorame.jpg", ok_cb, false)
if string.starts(msg.text, "/neorame") then
send_photo(get_receiver(msg), "pictures/neorame.jpg", ok_cb, false)
end
end end
return { return {
@ -10,4 +7,5 @@ return {
usage = "/neorame", usage = "/neorame",
patterns = {"^/neorame"}, patterns = {"^/neorame"},
run = run run = run
} }
--by Akamaru

View File

@ -1,9 +1,5 @@
function run(msg, matches) function run(msg, matches)
send_photo(get_receiver(msg), "pictures/Nii-san.jpg", ok_cb, false)
if string.starts(msg.text, 'nii-san') or string.starts(msg.text, 'Nii-san') or string.starts(msg.text, 'Nissan') or string.starts(msg.text, 'nissan') then
send_photo(get_receiver(msg), "pictures/Nii-san.jpg", ok_cb, false)
end
end end
return { return {
@ -15,4 +11,4 @@ return {
"^Nissan"}, "^Nissan"},
run = run run = run
} }
--by Akamaru

View File

@ -1,9 +1,6 @@
function run(msg, matches) function run(msg, matches)
if matches[1] == "nope.avi" then return 'https://www.youtube.com/watch?v=gvdf5n-zI14'
return 'https://www.youtube.com/watch?v=gvdf5n-zI14'
end
end end
return { return {
@ -12,4 +9,4 @@ return {
patterns = {"^nope.avi"}, patterns = {"^nope.avi"},
run = run run = run
} }
--by Akamaru

View File

@ -1,16 +1,12 @@
function run(msg, matches) function run(msg, matches)
send_photo(get_receiver(msg), "pictures/nyu.jpg", ok_cb, false)
if string.starts(msg.text, 'nyu') or string.starts(msg.text, 'Nyu') then
send_photo(get_receiver(msg), "pictures/nyu.jpg", ok_cb, false)
end
end end
return { return {
description = "Nyu?", description = "Nyu?",
usage = "nyu", usage = "nyu",
patterns = {"^nyu", patterns = {"^nyu",
"^Nyu"}, "^Nyu"},
run = run run = run
} }
--by Akamaru

View File

@ -6,12 +6,12 @@ function run(msg, matches)
-- local new_matches = {query} -- local new_matches = {query}
-- return g.run(msg, new_matches) -- return g.run(msg, new_matches)
local results = findPorn(matches[1]) local results = findPornhub(matches[1])
return results-- build_result(results) return results-- build_result(results)
end end
function findPorn(query) function findPornhub(query)
local api = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=site:pornhub.com+viewkey+" .. query:gsub(" ", "+") local api = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=site:pornhub.com+viewkey+" .. query:gsub(" ", "+")
-- Do the request -- Do the request
local res, code = https.request(api) local res, code = https.request(api)
@ -41,7 +41,7 @@ function build_result(query)
end end
return { return {
description = "", description = "Sendet ein PornHub Video",
usage = "/pornhub", usage = "/pornhub",
patterns = {"^/pornhub (.*)$", patterns = {"^/pornhub (.*)$",
"^/ph (.*)$"}, "^/ph (.*)$"},

View File

@ -7,8 +7,6 @@ end
return { return {
description = "Ein simpler Taschenrechner", description = "Ein simpler Taschenrechner",
usage = "/calc [Rechnung]", usage = "/calc [Rechnung]",
patterns = { patterns = {"^/calc (.*)$"},
"^/calc (.*)$"
},
run = run run = run
} }

View File

@ -1,12 +1,12 @@
function run(msg, matches) function run(msg, matches)
plugins = {} plugins = {}
load_plugins() load_plugins()
return 'Plugins reloaded' return 'Plugins erfolgreich geladen!'
end end
return { return {
description = "Reloads Bot Plugins", description = "",
usage = "/reload", usage = "",
patterns = {"^/reload$"}, patterns = {"^/reload$"},
run = run, run = run,
privileged = true privileged = true

View File

@ -1,9 +1,6 @@
function run(msg, matches) function run(msg, matches)
if matches[1] == "rich bitch" then return 'Akamaru ist nicht reich!'
return 'Akamaru ist nicht reich!'
end
end end
return { return {
@ -16,4 +13,4 @@ return {
"^RICH BITCH"}, "^RICH BITCH"},
run = run run = run
} }
--by Akamaru

View File

@ -4,27 +4,27 @@ function run(msg, matches)
send_photo(get_receiver(msg), "pictures/sakurasou/shiina.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/sakurasou/shiina.jpg", ok_cb, false)
end end
if string.starts(msg.text, '/chihiro') or string.starts(msg.text, "/Chihiro") then if string.starts(msg.text, '/chihiro') or string.starts(msg.text, "/Chihiro") then
send_photo(get_receiver(msg), "pictures/sakurasou/chihiro.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/sakurasou/chihiro.jpg", ok_cb, false)
end end
if string.starts(msg.text, '/jin') or string.starts(msg.text, "/Jin") then if string.starts(msg.text, '/jin') or string.starts(msg.text, "/Jin") then
send_photo(get_receiver(msg), "pictures/sakurasou/jin.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/sakurasou/jin.jpg", ok_cb, false)
end end
if string.starts(msg.text, '/misaki') or string.starts(msg.text, "/Misaki") then if string.starts(msg.text, '/misaki') or string.starts(msg.text, "/Misaki") then
send_photo(get_receiver(msg), "pictures/sakurasou/misaki.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/sakurasou/misaki.jpg", ok_cb, false)
end end
if string.starts(msg.text, '/nanami') or string.starts(msg.text, "/Nanami") then if string.starts(msg.text, '/nanami') or string.starts(msg.text, "/Nanami") then
send_photo(get_receiver(msg), "pictures/sakurasou/nanami.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/sakurasou/nanami.jpg", ok_cb, false)
end end
if string.starts(msg.text, '/ryuunosuke') or string.starts(msg.text, "/Ryuunosuke") then if string.starts(msg.text, '/ryuunosuke') or string.starts(msg.text, "/Ryuunosuke") then
send_photo(get_receiver(msg), "pictures/sakurasou/ryuunosuke.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/sakurasou/ryuunosuke.jpg", ok_cb, false)
end end
if string.starts(msg.text, '/sorata') or string.starts(msg.text, "/Sorata") then if string.starts(msg.text, '/sorata') or string.starts(msg.text, "/Sorata") then
send_photo(get_receiver(msg), "pictures/sakurasou/sorata.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/sakurasou/sorata.jpg", ok_cb, false)
end end
end end
@ -47,4 +47,5 @@ return {
"^/sorata", "^/sorata",
"^/Sorata"}, "^/Sorata"},
run = run run = run
} }
--by Akamaru

View File

@ -4,39 +4,39 @@ function run(msg, matches)
send_photo(get_receiver(msg), "pictures/senrankagura/hanzouacademy/asuka.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/senrankagura/hanzouacademy/asuka.jpg", ok_cb, false)
end end
if string.starts(msg.text, '/hibari') or string.starts(msg.text, "/Hibari") then if string.starts(msg.text, '/hibari') or string.starts(msg.text, "/Hibari") then
send_photo(get_receiver(msg), "pictures/senrankagura/hanzouacademy/hibari.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/senrankagura/hanzouacademy/hibari.jpg", ok_cb, false)
end end
if string.starts(msg.text, '/ikaruga') or string.starts(msg.text, "/Ikaruga") then if string.starts(msg.text, '/ikaruga') or string.starts(msg.text, "/Ikaruga") then
send_photo(get_receiver(msg), "pictures/senrankagura/hanzouacademy/ikaruga.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/senrankagura/hanzouacademy/ikaruga.jpg", ok_cb, false)
end end
if string.starts(msg.text, '/katsuragi') or string.starts(msg.text, "/Katsuragi") then if string.starts(msg.text, '/katsuragi') or string.starts(msg.text, "/Katsuragi") then
send_photo(get_receiver(msg), "pictures/senrankagura/hanzouacademy/katsuragi.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/senrankagura/hanzouacademy/katsuragi.jpg", ok_cb, false)
end end
if string.starts(msg.text, '/yagyuu') or string.starts(msg.text, "/Yagyuu") then if string.starts(msg.text, '/yagyuu') or string.starts(msg.text, "/Yagyuu") then
send_photo(get_receiver(msg), "pictures/senrankagura/hanzouacademy/yagyuu.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/senrankagura/hanzouacademy/yagyuu.jpg", ok_cb, false)
end end
if string.starts(msg.text, '/haruka') or string.starts(msg.text, "/Haruka") then if string.starts(msg.text, '/haruka') or string.starts(msg.text, "/Haruka") then
send_photo(get_receiver(msg), "pictures/senrankagura/hebijoacademy/haruka.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/senrankagura/hebijoacademy/haruka.jpg", ok_cb, false)
end end
if string.starts(msg.text, '/hikage') or string.starts(msg.text, "/Hikage") then if string.starts(msg.text, '/hikage') or string.starts(msg.text, "/Hikage") then
send_photo(get_receiver(msg), "pictures/senrankagura/hebijoacademy/hikage.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/senrankagura/hebijoacademy/hikage.jpg", ok_cb, false)
end end
if string.starts(msg.text, '/homura') or string.starts(msg.text, "/Homura") then if string.starts(msg.text, '/homura') or string.starts(msg.text, "/Homura") then
send_photo(get_receiver(msg), "pictures/senrankagura/hebijoacademy/homura.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/senrankagura/hebijoacademy/homura.jpg", ok_cb, false)
end end
if string.starts(msg.text, '/mirai') or string.starts(msg.text, "/Mirai") then if string.starts(msg.text, '/mirai') or string.starts(msg.text, "/Mirai") then
send_photo(get_receiver(msg), "pictures/senrankagura/hebijoacademy/mirai.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/senrankagura/hebijoacademy/mirai.jpg", ok_cb, false)
end end
if string.starts(msg.text, '/yomi') or string.starts(msg.text, "/Yomi") then if string.starts(msg.text, '/yomi') or string.starts(msg.text, "/Yomi") then
send_photo(get_receiver(msg), "pictures/senrankagura/hebijoacademy/yomi.jpg", ok_cb, false) send_photo(get_receiver(msg), "pictures/senrankagura/hebijoacademy/yomi.jpg", ok_cb, false)
end end
end end
@ -66,4 +66,4 @@ return {
"^/Yomi"}, "^/Yomi"},
run = run run = run
} }
--by Akamaru

View File

@ -1,12 +1,12 @@
do do
function run(msg, matches) function run(msg, matches)
local answers = {'Ja, es ist sehr ruhig hier','Wenn es dir zu still ist, kannst du gerne mit mir reden','*SCHREI*', local answers = {'Ja, es ist sehr ruhig hier','Wenn es dir zu still ist, kannst du gerne mit mir reden',
'Dann mach doch etwas dagegen!','Möpse?','Vermutlich schlafen alle', '*SCHREI*','Dann mach doch etwas dagegen!','Möpse?','Vermutlich schlafen alle',
'Stört dich die Stille?','Nein, es ist nicht still','Nyu?', 'Stört dich die Stille?','Nein, es ist nicht still','Nyu?','Besser als Spam','Stille ist schön',
'Besser als Spam','Stille ist schön',
'Mein Name ist Mikubot','Spiel doch etwas http://curvefever.com/', 'Mein Name ist Mikubot','Spiel doch etwas http://curvefever.com/',
'Stille sagt manchmal mehr als tausend Worte','Stille und Nacht sind untrennbar verwoben. Die Nacht ist die Stille unter den Sternen.'} 'Stille sagt manchmal mehr als tausend Worte',
'Stille und Nacht sind untrennbar verwoben. Die Nacht ist die Stille unter den Sternen.'}
return answers[math.random(#answers)] return answers[math.random(#answers)]
end end
@ -19,5 +19,5 @@ return {
"^*Stille*"}, "^*Stille*"},
run = run run = run
} }
end end
--by Akamaru

View File

@ -38,11 +38,11 @@ function run(msg, matches)
return "Fehler: "..response_code return "Fehler: "..response_code
end end
local data = json:decode(response_body) local data = json:decode(response_body)
return "Tweet gesendet! Sieh ihn dir an: https://twitter.com/TalesOfTelegram/status/"..data.id_str return "Tweet gesendet!"..data.id_str
end end
return { return {
description = "Sends a tweet", description = "",
usage = "", usage = "",
patterns = {"^/tw (.+)"}, patterns = {"^/tw (.+)"},
run = run, run = run,

View File

@ -25,14 +25,14 @@ end
function run(msg, matches) function run(msg, matches)
local text = getUrbanDictionary(msg.text) local text = getUrbanDictionary(msg.text)
if (text == nil) then if (text == nil) then
return "Zzzzz..." return "Nichts gefunden!"
else else
return text return text
end end
end end
return { return {
description = "get urban dictionary definition", description = "Zeigt eine Urban Dictionary Definition",
usage = "/ud [topic]", usage = "/ud [topic]",
patterns = {"^/ud (.*)$"}, patterns = {"^/ud (.*)$"},
run = run run = run

View File

@ -27,8 +27,15 @@ function run(msg, matches)
local result = http.request(url) local result = http.request(url)
local title = getTitle(result) local title = getTitle(result)
-- We don't want 301 (and one Extrawurst for Google), 302, 404 and empty titles --Ignoring 301, 302, 404 and more
if title == "301 Moved Permanently" or title == "" or title == "404 Not Found" or title == "302 Found" or title == "Moved Permanently" or string.match(title, "DeviantArt") then if title == "301 Moved Permanently" or
title == "" or
title == "404 Not Found" or
title == "302 Found" or
title == "Moved Permanently" or
string.match(title, "deviantArt") or
string.match(title, "twitch") or
string.match(title, "eBay</title>") then
print('Invalide, da "'..title..'"') print('Invalide, da "'..title..'"')
else else
return title return title
@ -37,11 +44,8 @@ function run(msg, matches)
return { return {
description = "Postet URL-Titel", description = "Postet URL-Titel",
usage = "", usage = "Irgendein Link",
patterns = { patterns = {"(https?://[%w-_%.%?%.:/%+=&]+)$",},
"(https?://[%w-_%.%?%.:/%+=&]+)$",
},
run = run run = run
} }
end end

View File

@ -12,5 +12,4 @@ return {
}, },
run = run run = run
} }
end end

View File

@ -6,8 +6,7 @@ end
return { return {
description = "Sagt dass ihr wieder da seid", description = "Sagt dass ihr wieder da seid",
usage = "/wd", usage = "/wd",
patterns = { patterns = {"^/wd(.*)$"},
"^/wd(.*)$"
},
run = run run = run
} }
--by Akamaru

View File

@ -4,10 +4,12 @@ function run(msg, matches)
local answers = {'1','2','3','4','5','6'} local answers = {'1','2','3','4','5','6'}
return answers[math.random(#answers)] return answers[math.random(#answers)]
end end
return { return {
description = "Würfel eine Zahl zwischen 1 bis 6", description = "Würfel eine Zahl zwischen 1 bis 6",
usage = "/würfel", usage = "/würfel",
patterns = {"^/würfel"}, patterns = {"^/würfel"},
run = run run = run
} }
end end
--by Akamaru

View File

@ -1,15 +1,12 @@
function run(msg, matches) function run(msg, matches)
if matches[1] == "yolo" then return 'Hä YOLO?'
return 'Hä YOLO?'
end
end end
return { return {
description = "Sendet euch ein Hä YOLO?", description = "Sendet euch ein Hä YOLO?",
usage = "/yolo", usage = "/yolo",
patterns = {"^/(yolo)"}, patterns = {"^/yolo"},
run = run run = run
} }
--by Akamaru

View File

@ -2,16 +2,16 @@
function run(msg, matches) function run(msg, matches)
-- local g = require "./plugins/google" -- local g = require "./plugins/google"
-- local query = "site:pornhub.com+viewkey+" .. matches[1] -- local query = "site:youporn.com+viewkey+" .. matches[1]
-- local new_matches = {query} -- local new_matches = {query}
-- return g.run(msg, new_matches) -- return g.run(msg, new_matches)
local results = findAss(matches[1]) local results = findYouporn(matches[1])
return results-- build_result(results) return results-- build_result(results)
end end
function findAss(query) function findYouporn(query)
local api = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=site:youporn.com+viewkey+" .. query:gsub(" ", "+") local api = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=site:youporn.com+viewkey+" .. query:gsub(" ", "+")
-- Do the request -- Do the request
local res, code = https.request(api) local res, code = https.request(api)
@ -41,7 +41,7 @@ function build_result(query)
end end
return { return {
description = "", description = "Sendet ein YouPorn Video",
usage = "/youporn", usage = "/youporn",
patterns = {"^/youporn (.*)$", patterns = {"^/youporn (.*)$",
"^/yp (.*)$"}, "^/yp (.*)$"},