Przeglądaj źródła

Make default !access behavior more reasonable.

tags/v0.2
Ben Kurtovic 11 lat temu
rodzic
commit
9ad03589a4
1 zmienionych plików z 5 dodań i 6 usunięć
  1. +5
    -6
      earwigbot/commands/access.py

+ 5
- 6
earwigbot/commands/access.py Wyświetl plik

@@ -30,11 +30,8 @@ class Access(Command):
commands = ["access", "permission", "permissions", "perm", "perms"]

def process(self, data):
if not data.args:
self.reply(data, "Subcommands are self, list, add, remove.")
return
permdb = self.config.irc["permissions"]
if data.args[0] == "self":
if not data.args or data.args[0] == "self":
self.do_self(data, permdb)
elif data.args[0] == "list":
self.do_list(data, permdb)
@@ -42,9 +39,11 @@ class Access(Command):
self.do_add(data, permdb)
elif data.args[0] == "remove":
self.do_remove(data, permdb)
elif data.args[0] == "help":
self.reply(data, "Subcommands are self, list, add, and remove.")
else:
msg = "Unknown subcommand \x0303{0}\x0F.".format(data.args[0])
self.reply(data, msg)
msg = "Unknown subcommand \x0303{0}\x0F. Subcommands are self, list, add, remove."
self.reply(data, msg.format(data.args[0]))

def do_self(self, data, permdb):
if permdb.is_owner(data):


Ładowanie…
Anuluj
Zapisz