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
import subprocess
import time
@pinhook.plugin.register('!figlet')
def figlet_plugin(msg):
if not msg.arg:
return pinhook.plugin.message("No text given. :(")
else:
lines = subprocess.Popen(
["figlet", "-w140"] + msg.arg.split(" "), shell=False, stdout=subprocess.PIPE
).stdout.read().decode("utf-8")
for line in lines.split("\n"):
msg.privmsg(msg.channel, line)
time.sleep(0.4) # to avoid channel throttle due to spamming