diff --git a/commands.json b/commands.json index b7768230f1d3524379a3b87cacfa1aceef3d0300..7f20336454e683d3babfb438221b42e3d067ee88 100644 --- a/commands.json +++ b/commands.json @@ -130,7 +130,7 @@ ".addQuote", ".createQuote" ], - "Description": "Syntax: .saveQuote <\"Quote\">, <Person>, <Year>. Save a quote. Type .savequote \"640 kB ought to be enough for anybody.\", Not Gates, 1981", + "Description": "Syntax: .saveQuote <\"Quote\">; <Person>; <Year>. Save a quote. Type .savequote \"640 kB ought to be enough for anybody.\"; Not Gates; 1981", "_Func": "save_quote", "allowedGroups":[] }, diff --git a/mod_eventreminder.py b/mod_eventreminder.py index e8557218e9a5a757370218fb376133feffc497cb..ce160f94fe81e957f4974222c74623dd2997a1ea 100644 --- a/mod_eventreminder.py +++ b/mod_eventreminder.py @@ -98,7 +98,7 @@ class ModuleEventReminder: def interpret_event_line(self, line): splitted = line.strip().split(";") - if not (1 < len(splitted) <= 3): + if not (1 < len(splitted) <= 3): # within range[2,3] raise SyntaxError("Invalid event syntax! Needs to be: " "headline ; date(Day.Month.Year) ; optional description.") headline = splitted[0].strip() @@ -107,7 +107,7 @@ class ModuleEventReminder: "headline; date(Day.Month.Year) ; optional description.") splittedDate = splitted[1].strip().split(".") - if len(splitted) != 3: + if len(splittedDate) != 3: raise SyntaxError("Invalid date! Needs to be: Day.Month.Year eg.: 02.09.21") day = splittedDate[0].strip() diff --git a/mod_quotes.py b/mod_quotes.py index bc6f475718f4ccd05adbc0ced133a707e45ab2dc..9d427bd89381ab63199a8172e450807ce8dace3e 100644 --- a/mod_quotes.py +++ b/mod_quotes.py @@ -2,7 +2,7 @@ import random # Input -# "Zitat", Person, Jahr +# "Zitat"; Person; Jahr # Output # "Lorem ipsum dolor sit amet!" @@ -29,7 +29,7 @@ class Quote: return f"{self.QUOTE}\n- {self.PERSON}, {self.YEAR}" def get_csv_line(self): - return f"{self.QUOTE},{self.PERSON},{self.YEAR}\n" + return f"{self.QUOTE};{self.PERSON};{self.YEAR}\n" class ModuleQuotes: @@ -43,11 +43,11 @@ class ModuleQuotes: self.log.debug(f"{self.tag}Modul Quotes geladen") def interpret_quote_line(self, line): - splitted = line.strip().split(",") + splitted = line.strip().split(";") if len(splitted) < 3: - raise SyntaxError("Invalid quote syntax! Needs to be: \"Quote\", person, year") + raise SyntaxError("Invalid quote syntax! Needs to be: \"Quote\"; person; year") - quote = Quote(",".join(splitted[0:-2]), splitted[-2], splitted[-1]) + quote = Quote(";".join(splitted[0:-2]), splitted[-2], splitted[-1]) return quote def save_quote(self, message, groupInfo):