Compare commits
No commits in common. "1e9f10d5492882cabd8ba7f3a4ce1fef63749494" and "5f4af12a2f829b25851a84557304b7101318edee" have entirely different histories.
1e9f10d549
...
5f4af12a2f
|
@ -149,7 +149,6 @@ class Bot(irc.client.SimpleIRCClient, Logger):
|
|||
|
||||
def say(self, target, message):
|
||||
"""Send message to target after a slight delay."""
|
||||
message = message.replace("\n", " ").replace("\r", " ")
|
||||
time.sleep(self.config["speak_delay"])
|
||||
self.log_d(f"Sending to {target}: {message}")
|
||||
try:
|
||||
|
|
|
@ -19,21 +19,16 @@ class JourneeMondialePlugin(Plugin):
|
|||
def on_pubmsg(self, event):
|
||||
if not self.should_handle_command(event.arguments[0], no_content=True):
|
||||
return False
|
||||
|
||||
response = http_get(self.config["url"])
|
||||
if not response:
|
||||
self.signal_failure(event.target)
|
||||
return True
|
||||
|
||||
soup = BeautifulSoup(response, "html.parser")
|
||||
try:
|
||||
jm = soup.find("div", id="journeesDuJour").find("h2").string
|
||||
except (ValueError, KeyError):
|
||||
self.signal_failure(event.target)
|
||||
return True
|
||||
|
||||
if jm:
|
||||
self.bot.say(event.target, jm)
|
||||
else:
|
||||
self.signal_failure(event.target)
|
||||
return True
|
||||
|
|
|
@ -150,14 +150,6 @@ class MiscReactionsPlugin(Plugin):
|
|||
if len(words) == 0:
|
||||
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)
|
||||
):
|
||||
num_repeats += 1
|
||||
repeated = biggest_word[:num_repeats]
|
||||
word = biggest_word[:2] + biggest_word
|
||||
question_mark = self.config["question_mark"]
|
||||
reply = f"{word}{question_mark}"
|
||||
|
|
Loading…
Reference in a new issue