Skip to content

Commit 0e2d9ef

Browse files
committed
I don't even this probably works
1 parent 68d2bdd commit 0e2d9ef

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

cloudbot/clients/irc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ def send(self, line):
277277
# make sure we are connected before sending
278278
if not self._connected:
279279
yield from self._connected_future
280-
line = line.splitlines()[0][:500] + "\r\n"
281-
data = line.encode("utf-8", "replace")
280+
line = line[:500] + "\r\n"
281+
data = line.encode("utf-8")
282282
self._transport.write(data)
283283

284284
def data_received(self, data):

plugins/password.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def password(text, notice):
3232

3333
if length > 50:
3434
notice("Maximum length is 50 characters.")
35+
return
3536

3637
# add alpha characters
3738
if "alpha" in text or "letter" in text:
@@ -65,18 +66,18 @@ def password(text, notice):
6566
@hook.command("wpass", "wordpass", "wordpassword", autohelp=False)
6667
def word_password(text, notice):
6768
"""[length] - generates an easy to remember password with [length] (default 4) commonly used words"""
68-
if text:
69-
try:
70-
length = int(text)
71-
except ValueError:
72-
notice("Invalid input '{}'".format(text))
73-
return
74-
else:
75-
length = 4
69+
try:
70+
length = int(text)
71+
except ValueError:
72+
length = 3
73+
74+
if length > 10:
75+
notice("Maximum length is 50 characters.")
76+
return
77+
7678
words = []
7779
# generate password
7880
for x in range(length):
7981
words.append(gen.choice(common_words))
8082

8183
notice("Your password is '{}'. Feel free to remove the spaces when using it.".format(" ".join(words)))
82-

0 commit comments

Comments
 (0)