Skip to content

Commit 55333d8

Browse files
authored
Merge pull request CloudBotIRC#108 from MuffinMedic/factoids
Add listdetailedfacts command
2 parents 5f933dc + 8b23f94 commit 55333d8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

plugins/factoids.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,12 @@ def listfactoids(notice, chan):
181181
reply_text.append(word)
182182
reply_text_length += added_length
183183
notice(", ".join(reply_text))
184+
185+
186+
@hook.command("listdetailedfacts", autohelp=False)
187+
def listdetailedfactoids(chan):
188+
"""- lists all available factoids with their respective data"""
189+
headers = ("Command", "Output")
190+
data = [(fact[0], fact[1]) for fact in factoid_cache[chan].items()]
191+
table = gen_markdown_table(headers, data).encode('UTF-8')
192+
return web.paste(table, "md", "hastebin")

0 commit comments

Comments
 (0)