Skip to content

Commit a4886d9

Browse files
author
MuffinMedic
committed
Sort output of listfacts and listdetailedfacts
1 parent 9bfdbca commit a4886d9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plugins/factoids.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def listfactoids(notice, chan):
171171
"""- lists all available factoids"""
172172
reply_text = []
173173
reply_text_length = 0
174-
for word in factoid_cache[chan].keys():
174+
for word in sorted(factoid_cache[chan].keys()):
175175
added_length = len(word) + 2
176176
if reply_text_length + added_length > 400:
177177
notice(", ".join(reply_text))
@@ -187,6 +187,6 @@ def listfactoids(notice, chan):
187187
def listdetailedfactoids(chan):
188188
"""- lists all available factoids with their respective data"""
189189
headers = ("Command", "Output")
190-
data = [(fact[0], fact[1]) for fact in factoid_cache[chan].items()]
190+
data = [(fact[0], fact[1]) for fact in sorted(factoid_cache[chan].items())]
191191
table = gen_markdown_table(headers, data).encode('UTF-8')
192192
return web.paste(table, "md", "hastebin")

0 commit comments

Comments
 (0)