mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 00:22:34 +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,19 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import pinhook.plugin
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
@pinhook.plugin.register('!toilet')
|
||||
def toilet_plugin(msg):
|
||||
if not msg.arg:
|
||||
return pinhook.plugin.message("No text given. :(")
|
||||
else:
|
||||
lines = subprocess.Popen(
|
||||
["toilet", "-w140", "-F", "crop", "--irc"] + 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
|
||||
Reference in new issue
Block a user