aboutsummaryrefslogtreecommitdiff
path: root/modules/rainbow.py
diff options
context:
space:
mode:
authorGravatar jesopo2020-01-30 11:54:40 +0000
committerGravatar jesopo2020-01-30 11:54:40 +0000
commitd2d774a644fc1aa8b84f719cc8b1e7e1a2eea566 (patch)
tree8773dfd0ae35473129cc3faebc88128f6f6d5554 /modules/rainbow.py
parentshow target user in !ping response (diff)
signature
update rainbow.py to use command spec
Diffstat (limited to 'modules/rainbow.py')
-rw-r--r--modules/rainbow.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/modules/rainbow.py b/modules/rainbow.py
index a7a174b9..972a6c23 100644
--- a/modules/rainbow.py
+++ b/modules/rainbow.py
@@ -21,18 +21,13 @@ COLORS = [
class Module(ModuleManager.BaseModule):
@utils.hook("received.command.rainbow")
@utils.kwarg("help", "Rainbowify a given string or the last message")
- @utils.kwarg("usage", "[string]")
+ @utils.spec("!<string>lstring")
def rainbow(self, event):
if event["is_channel"] and not event["target"].get_setting(
"rainbow", False):
return
- args = event["args"]
- if not args:
- args = event["target"].buffer.get()
- if not args:
- raise utils.EventError("No line found to rainbowify")
- args = utils.irc.strip_font(args)
+ args = utils.irc.strip_font(event["spec"][0])
offset = random.randint(0, len(COLORS))
out = ""