split %\n

This commit is contained in:
Gordon Shumway 2019-05-09 01:04:41 -04:00 committed by GitHub
parent 744c1b46d8
commit 36fff72a61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1087,7 +1087,7 @@ class ASCII(callbacks.Plugin):
delay = self.registryValue('delay', msg.args[0])
data = open("{0}/fortune.txt".format(os.path.dirname(os.path.abspath(__file__))))
text = data.read()
reply = re.split('^%', text)
reply = text.split('%\n')
fortune = random.randrange(0, len(reply))
for line in reply[fortune].splitlines():
if not line.strip() and not self.stopped[msg.args[0]]: