Ported banterbot to pinhook framework and some other changes

This commit is contained in:
RussellChamp committed 2019-01-25 11:16:19 -05:00
1 parent 0627b4a9e3
commit bc102890b2
39 files changed
+1629 -507

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/python3
import pinhook.plugin
from util import wikiphilosophy
@pinhook.plugin.register('!wphilosophy')
def wiki_philosophy_plugin(msg):
msg.privmsg(msg.channel, "Ok, give me a minute while I look up '{}'".format(msg.arg))
steps = wikiphilosophy.get_philosophy_lower(msg.arg)
if not steps:
return pinhook.plugin.message("Couldn't find a wikipedia entry for {}".format(msg.arg))
else:
joined_steps = " > ".join(steps)
if steps[-1] == "Philosophy":
joined_steps += "!!!"
for line in [ joined_steps[i : i + 400] for i in range(0, len(joined_steps), 400) ]:
msg.privmsg(msg.channel, line)