allow !markovfor outside a channel when you share the channel with bitbot
This commit is contained in:
parent
355689bb35
commit
37e375c31f
1 changed files with 3 additions and 1 deletions
|
@ -97,12 +97,14 @@ class Module(ModuleManager.BaseModule):
|
||||||
|
|
||||||
@utils.hook("received.command.markovfor")
|
@utils.hook("received.command.markovfor")
|
||||||
@utils.kwarg("min_args", 1)
|
@utils.kwarg("min_args", 1)
|
||||||
@utils.kwarg("permission", "markovfor")
|
|
||||||
@utils.kwarg("help", "Generate a markov chain for a given channel")
|
@utils.kwarg("help", "Generate a markov chain for a given channel")
|
||||||
@utils.kwarg("usage", "<channel> [first-word]")
|
@utils.kwarg("usage", "<channel> [first-word]")
|
||||||
def markov_for(self, event):
|
def markov_for(self, event):
|
||||||
if event["args_split"][0] in event["server"].channels:
|
if event["args_split"][0] in event["server"].channels:
|
||||||
channel = event["server"].channels.get(event["args_split"][0])
|
channel = event["server"].channels.get(event["args_split"][0])
|
||||||
|
if not channel.has_user(event["user"]):
|
||||||
|
event["check_assert"](utils.Check("permission", "markovfor"))
|
||||||
|
|
||||||
self._markov_for(channel, event["stdout"], event["stderr"],
|
self._markov_for(channel, event["stdout"], event["stderr"],
|
||||||
first_words=event["args_split"][1:])
|
first_words=event["args_split"][1:])
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue