Procházet zdrojové kódy

Fixing up !restart and !reload a bit

tags/v0.1^2
Ben Kurtovic před 12 roky
rodič
revize
079b424eca
2 změnil soubory, kde provedl 6 přidání a 5 odebrání
  1. +1
    -1
      earwigbot/commands/__init__.py
  2. +5
    -4
      earwigbot/commands/restart.py

+ 1
- 1
earwigbot/commands/__init__.py Zobrazit soubor

@@ -126,8 +126,8 @@ class CommandManager(object):

def load(self):
"""Load (or reload) all valid commands into self._commands."""
self._commands = {}
with self._command_access_lock:
self._commands.clear()
dirs = [path.join(path.dirname(__file__), "commands"),
path.join(bot.config.root_dir, "commands")]
for dir in dirs:


+ 5
- 4
earwigbot/commands/restart.py Zobrazit soubor

@@ -38,9 +38,10 @@ class Command(BaseCommand):
return

if data.command == "restart":
self.connection.logger.info("Restarting bot per owner request")
self.connection.bot.restart()
self.logger.info("Restarting bot per owner request")
self.bot.restart()

elif data.command == "reload":
self.connection.bot.commands.load()
self.connection.logger.info("IRC commands reloaded")
self.logger.info("Reloading IRC commands")
self.bot.commands.load()
self.connection.reply("IRC commands reloaded.")

Načítá se…
Zrušit
Uložit