|
|
|
@ -31,6 +31,7 @@ class MiscReactionsPlugin(Plugin):
|
|
|
|
|
"detector",
|
|
|
|
|
"repeat_letters",
|
|
|
|
|
"nudge",
|
|
|
|
|
"pfouah",
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@ -160,13 +161,14 @@ class MiscReactionsPlugin(Plugin):
|
|
|
|
|
return
|
|
|
|
|
biggest_word = sorted(words, key=lambda w: len(w))[-1]
|
|
|
|
|
num_repeats = 2
|
|
|
|
|
repeated = biggest_word[:num_repeats]
|
|
|
|
|
while (not any(letter in repeated for letter in "aeiouy")) and len(
|
|
|
|
|
repeated
|
|
|
|
|
) < len(biggest_word):
|
|
|
|
|
repeated_prefix = biggest_word[:num_repeats]
|
|
|
|
|
while (
|
|
|
|
|
(not any(letter in repeated_prefix for letter in "aeiouy"))
|
|
|
|
|
and len(repeated_prefix) < len(biggest_word)
|
|
|
|
|
):
|
|
|
|
|
num_repeats += 1
|
|
|
|
|
repeated = biggest_word[:num_repeats]
|
|
|
|
|
word = biggest_word[:2] + biggest_word
|
|
|
|
|
repeated_prefix = biggest_word[:num_repeats]
|
|
|
|
|
word = repeated_prefix + biggest_word
|
|
|
|
|
question_mark = self.config["question_mark"]
|
|
|
|
|
reply = f"{word}{question_mark}"
|
|
|
|
|
self.bot.say(event.target, reply)
|
|
|
|
@ -178,3 +180,21 @@ class MiscReactionsPlugin(Plugin):
|
|
|
|
|
if reply is None:
|
|
|
|
|
return
|
|
|
|
|
self.bot.say(event.target, reply.format(target=nick))
|
|
|
|
|
|
|
|
|
|
def react_with_pfouah(self, event):
|
|
|
|
|
"""Sigh and say you're feeling like a made-up word."""
|
|
|
|
|
if any(
|
|
|
|
|
k not in self.config
|
|
|
|
|
for k in ("pfouah_sentence", "pfouah1", "pfouah2", "pfouah3")
|
|
|
|
|
):
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
length = random.choice((2, 3))
|
|
|
|
|
word = random.choice(self.config["pfouah1"])
|
|
|
|
|
if length == 3:
|
|
|
|
|
word += random.choice(self.config["pfouah2"])
|
|
|
|
|
word += random.choice(self.config["pfouah3"])
|
|
|
|
|
|
|
|
|
|
text = self.config["pfouah_sentence"].format(word=word)
|
|
|
|
|
self.bot.say(event.target, text)
|
|
|
|
|
return True
|
|
|
|
|