mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 00:22:34 +00:00
Converted tildebot to pinhook framework. Moved other things around. Util-ified stuff
This commit is contained in:
1 parent
bc102890b2
commit
5f1bf146c3
52 files changed
+141
-6679
No files matched your search
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import pinhook.plugin
|
||||
|
||||
@pinhook.plugin.register('!')
|
||||
def _plugin(msg):
|
||||
return pinhook.plugin.message()
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import pinhook.plugin
|
||||
import subprocess
|
||||
|
||||
UNITS_CMD = "/home/krowbar/Code/units/units-2.11/units"
|
||||
UNITS_CFG = "/home/krowbar/Code/units/units-2.11/definitions.units"
|
||||
|
||||
@pinhook.plugin.register('!units')
|
||||
def units_plugin(msg):
|
||||
if not msg.arg:
|
||||
return pinhook.plugin.message("No text given. :(")
|
||||
else:
|
||||
result = subprocess.Popen(
|
||||
[UNITS_CMD, "-v1f", UNITS_CFG] + msg.arg.split(" "), shell=False, stdout=subprocess.PIPE
|
||||
).stdout.read().decode("utf-8").strip()
|
||||
return pinhook.plugin.message(result)
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import pinhook.plugin
|
||||
from util import xkcdApropos
|
||||
import util.xkcdApropos
|
||||
|
||||
@pinhook.plugin.register('!xkcd')
|
||||
def xkcd_plugin(msg):
|
||||
return pinhook.plugin.message(xkcdApropos.xkcd(msg.arg))
|
||||
return pinhook.plugin.message(util.xkcdApropos.xkcd(msg.arg))
|
||||
Reference in new issue
Block a user