Skip to content

Commit a97044a

Browse files
author
MuffinMedic
committed
Add listdetailedfacts command
Outputs all the factoids and their corresponding text, posts to a pastebin, and returns the URL
1 parent 9455941 commit a97044a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

plugins/factoids.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,15 @@ 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(notice, chan, bot):
188+
"""- lists all available factoids with their respective data"""
189+
formatted_facts = []
190+
for fact in sorted(factoid_cache[chan].items()):
191+
fact = fact[0] + ": " + fact[1]
192+
formatted_facts.append(fact)
193+
194+
data = '\n'.join(formatted_facts).encode('UTF-8')
195+
return web.paste(data, service="hastebin")

0 commit comments

Comments
 (0)