|
@@ -184,3 +184,13 @@ def riddle(bot, message, log):
|
|
|
riddle[0],
|
|
|
f"I'll post the response in about {get_config('riddle.sleep_time')} seconds!",
|
|
|
))
|
|
|
+
|
|
|
+
|
|
|
+@as_plugin
|
|
|
+def fortune():
|
|
|
+ sesh = HTMLSession()
|
|
|
+ r = sesh.get("http://www.fortunecookiemessage.com/")
|
|
|
+ quote = r.html.xpath("//div[contains(@class, 'quote')]/a")[0].text
|
|
|
+ learn, lotto = [x.split(":", 1)[-1].strip() for x in r.html.xpath("//div[contains(@class, 'bottom-message')]")[0].text.split("\n")[:2]]
|
|
|
+
|
|
|
+ return f"'{quote}'\nLucky Numbers: {lotto}\nLearn Chinese: {learn}"
|