aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2019-09-24 10:51:25 +0100
committerGravatar jesopo2019-09-24 10:51:25 +0100
commit5ea714182dd76ae6b97ebb201c31eabed1c99b51 (patch)
treecd36d3398555fec5d7649af2cfd6fac0d0a0555a
parentsupport first_word with no found second_word (diff)
signature
support first-word argument to !markovfor
-rw-r--r--modules/markov.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/markov.py b/modules/markov.py
index bc727557..5b0a157e 100644
--- a/modules/markov.py
+++ b/modules/markov.py
@@ -84,6 +84,7 @@ class Module(ModuleManager.BaseModule):
@utils.hook("received.command.markov")
@utils.kwarg("channel_only", True)
@utils.kwarg("help", "Generate a markov chain for the current channel")
+ @utils.kwarg("usage", "[first-word]")
def markov(self, event):
self._markov_for(event["target"], event["stdout"], event["stderr"],
first_word=(event["args_split"] or [None])[0])
@@ -92,11 +93,12 @@ class Module(ModuleManager.BaseModule):
@utils.kwarg("min_args", 1)
@utils.kwarg("permission", "markovfor")
@utils.kwarg("help", "Generate a markov chain for a given channel")
- @utils.kwarg("usage", "<channel>")
+ @utils.kwarg("usage", "<channel> [first-word]")
def markov_for(self, event):
if event["args_split"][0] in event["server"].channels:
channel = event["server"].channels.get(event["args_split"][0])
- self._markov_for(channel, event["stdout"], event["stderr"])
+ self._markov_for(channel, event["stdout"], event["stderr"],
+ first_word=(event["args_split"][1:] or [None])[0])
else:
event["stderr"].write("Unknown channel")