From 47f08e01a4198365e26f48e3644988c1f8984076 Mon Sep 17 00:00:00 2001 From: Akamaru Date: Tue, 7 Jul 2015 14:26:58 +0200 Subject: [PATCH] date plugin overwritten --- plugins/date.lua | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/plugins/date.lua b/plugins/date.lua index e1ea213..887c9d9 100644 --- a/plugins/date.lua +++ b/plugins/date.lua @@ -1,10 +1,36 @@ function run(msg, matches) - return os.date("Heute ist der %d.%m.%Y und es ist %H:%M:%S") + text = os.date("Heute ist %A der %d. %B (%m) %Y und es ist %H:%M:%S %p Uhr") + + -- Days + text = string.gsub(text, "Monday", "Montag") + text = string.gsub(text, "Tuesday", "Dienstag") + text = string.gsub(text, "Wednesday", "Mittwoch") + text = string.gsub(text, "Thursday", "Donnerstag") + text = string.gsub(text, "Friday", "Freitag") + text = string.gsub(text, "Saturday", "Samsstag") + text = string.gsub(text, "Sunday", "Sonntag") + + -- Months + text = string.gsub(text, "January", "Januar") + text = string.gsub(text, "February", "Februar") + text = string.gsub(text, "March", "März") + text = string.gsub(text, "April", "April") + text = string.gsub(text, "May", "Mai") + text = string.gsub(text, "June", "Juni") + text = string.gsub(text, "July", "Juli") + text = string.gsub(text, "August", "August") + text = string.gsub(text, "September", "September") + text = string.gsub(text, "October", "Oktober") + text = string.gsub(text, "November", "November") + text = string.gsub(text, "December", "Dezember") + + return text end return { description = "Zeigt das aktuelle Datum und Zeit an", usage = {"/date"}, - patterns = {"^/date$"}, + patterns = {"^/[D|d]ate$","^/[D|d]atum$"}, run = run } +--by Akamaru [https://ponywave.de] \ No newline at end of file