mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 08:32:32 +00:00
Ported banterbot to pinhook framework and some other changes
This commit is contained in:
1 parent
0627b4a9e3
commit
bc102890b2
39 files changed
+1629
-507
No files matched your search
@@ -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)
|
||||
Reference in new issue
Block a user