Skip to content

Commit 5a476f7

Browse files
authored
Merge pull request CloudBotIRC#144 from MuffinMedic/factoids
Sort output of listfacts and listdetailedfacts
2 parents e6b0102 + d09b12a commit 5a476f7

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
@@ -167,7 +167,7 @@ def listfactoids(notice, chan):
167167
"""- lists all available factoids"""
168168
reply_text = []
169169
reply_text_length = 0
170-
for word in factoid_cache[chan].keys():
170+
for word in sorted(factoid_cache[chan].keys()):
171171
added_length = len(word) + 2
172172
if reply_text_length + added_length > 400:
173173
notice(", ".join(reply_text))
@@ -183,6 +183,6 @@ def listfactoids(notice, chan):
183183
def listdetailedfactoids(chan):
184184
"""- lists all available factoids with their respective data"""
185185
headers = ("Command", "Output")
186-
data = [(fact[0], fact[1]) for fact in factoid_cache[chan].items()]
186+
data = [(FACTOID_CHAR + fact[0], fact[1]) for fact in sorted(factoid_cache[chan].items())]
187187
table = gen_markdown_table(headers, data).encode('UTF-8')
188188
return web.paste(table, "md", "hastebin")

0 commit comments

Comments
 (0)