22 lines
532 B
Python
22 lines
532 B
Python
import time
|
|
|
|
from edmond.plugin import Plugin
|
|
from edmond.utils import http_get
|
|
|
|
|
|
class HoroscopePlugin(Plugin):
|
|
|
|
COMMANDS = ["horoscope"]
|
|
|
|
def __init__(self, bot):
|
|
super().__init__(bot)
|
|
|
|
def on_pubmsg(self, event):
|
|
if not self.should_handle_command(event.arguments[0]):
|
|
return False
|
|
self.bot.say(event.target, "/me looks at the stars")
|
|
time.sleep(self.config["delay"])
|
|
text = http_get(self.config["url"])
|
|
if text:
|
|
self.bot.say(event.target, text)
|