unknown_question: fix usage of misc_reactions
This commit is contained in:
parent
806ef07e0c
commit
16d0df2a44
|
@ -58,13 +58,16 @@ class MiscReactionsPlugin(Plugin):
|
|||
|
||||
def on_pubmsg(self, event):
|
||||
if proc(self.config["rate"]):
|
||||
self.react(event)
|
||||
return True
|
||||
return False
|
||||
|
||||
def react(self, event):
|
||||
if self.weights:
|
||||
method = random.choices(self.reactions, self.weights)[0]
|
||||
else:
|
||||
method = random.choice(self.reactions)
|
||||
method(event)
|
||||
return True
|
||||
return False
|
||||
|
||||
def react_with_sentence(self, event):
|
||||
"""React with a random sentence from config list."""
|
||||
|
|
|
@ -26,7 +26,7 @@ class UnknownQuestionPlugin(Plugin):
|
|||
if message is None:
|
||||
return False
|
||||
if self.misc_plugin and proc(self.config["pass_to_misc_rate"]):
|
||||
return self.misc_plugin.on_pubmsg(event)
|
||||
self.misc_plugin.react(event)
|
||||
else:
|
||||
self.bot.say(event.target, "?" * random.randint(1, 3))
|
||||
return True
|
||||
|
|
Loading…
Reference in a new issue