Przeglądaj źródła

Refactor actual praises out of praise; fix replag

tags/v0.1^2
Ben Kurtovic 12 lat temu
rodzic
commit
1afa10cbc5
2 zmienionych plików z 19 dodań i 17 usunięć
  1. +18
    -16
      earwigbot/commands/praise.py
  2. +1
    -1
      earwigbot/commands/replag.py

+ 18
- 16
earwigbot/commands/praise.py Wyświetl plik

@@ -25,22 +25,24 @@ from earwigbot.commands import BaseCommand
class Command(BaseCommand):
"""Praise people!"""
name = "praise"
commands = ["praise", "earwig", "leonard", "leonard^bloom", "groove",
"groovedog"]

def setup(self):
try:
self.praises = self.config.commands[self.name]["praises"]
except KeyError:
self.praises = []

def check(self, data):
check = data.command == "praise" or data.command in self.praises
return data.is_command and check

def process(self, data):
if data.command == "earwig":
msg = "\x02Earwig\x0F is the bestest Python programmer ever!"
elif data.command in ["leonard", "leonard^bloom"]:
msg = "\x02Leonard^Bloom\x0F is the biggest slacker ever!"
elif data.command in ["groove", "groovedog"]:
msg = "\x02GrooveDog\x0F is the bestest heh evar!"
else:
if not data.args:
msg = "You use this command to praise certain people. Who they are is a secret."
else:
msg = "You're doing it wrong."
self.reply(data, msg)
if data.command in self.praises:
msg = self.praises[data.command]
self.say(data.chan, msg)
return

self.say(data.chan, msg)
if not data.args:
msg = "You use this command to praise certain people. Who they are is a secret."
else:
msg = "you're doing it wrong."
self.reply(data, msg)

+ 1
- 1
earwigbot/commands/replag.py Wyświetl plik

@@ -32,7 +32,7 @@ class Command(BaseCommand):

def setup(self):
try:
self.key = self.config.commands[self.name]["default"]
self.default = self.config.commands[self.name]["default"]
except KeyError:
self.default = None



Ładowanie…
Anuluj
Zapisz