From 5ea714182dd76ae6b97ebb201c31eabed1c99b51 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 24 Sep 2019 10:51:25 +0100 Subject: [PATCH] support first-word argument to !markovfor --- modules/markov.py | 6 ++++-- 1 file 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", "") + @utils.kwarg("usage", " [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")