You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
590 B

import time
from edmond.plugin import Plugin
from edmond.utils import http_get
class HoroscopePlugin(Plugin):
REQUIRED_CONFIGS = ["commands", "meditation", "delay", "url"]
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, self.config["meditation"])
time.sleep(self.config["delay"])
text = http_get(self.config["url"])
if text:
self.bot.say(event.target, text)
return True