home
·
contact
·
privacy
projects
/
plomlombot-irc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e10a953
)
Simplify quote line counting.
author
Christian Heller
<c.heller@plomlompom.de>
Fri, 22 Jan 2016 01:59:14 +0000
(
02:59
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Fri, 22 Jan 2016 01:59:14 +0000
(
02:59
+0100)
plomlombot.py
patch
|
blob
|
history
diff --git
a/plomlombot.py
b/plomlombot.py
index 9da116646679d15cb582a18e21ffb6026512361e..4befc396de3539871b95c1442bcbfd77b9e259b4 100755
(executable)
--- a/
plomlombot.py
+++ b/
plomlombot.py
@@
-151,8
+151,9
@@
def lineparser_loop(io, nickname):
quotesfile = open(quotesfile_name, "r")
lines = quotesfile.readlines()
quotesfile.close()
- i = random.randrange(len(lines) - 1) + 1
- notice("QUOTE #" + str(i) + ": " + lines[i])
+ lines = lines[1:]
+ i = random.randrange(len(lines))
+ notice("QUOTE #" + str(i + 1) + ": " + lines[i])
sender = ""
for rune in tokens[0]: