summaryrefslogtreecommitdiffstats
path: root/cholerab/IRC-RPC
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2011-09-12 14:32:18 +0200
committermakefu <github@syntax-fehler.de>2011-09-12 14:32:18 +0200
commit9f70f9b5b462aa3e150b9708f695edfaf716edd4 (patch)
tree5cbebe6cbc0ada2c988d7f14d0bbbc52a68b37c1 /cholerab/IRC-RPC
parent568fbd7fa5541182bbbc33560863ec9c3ff01d48 (diff)
parenta07326f6c57a7e8f49b9bef96ded427275a16e2e (diff)
Merge branch 'master' into punani_files
Diffstat (limited to 'cholerab/IRC-RPC')
-rw-r--r--cholerab/IRC-RPC32
1 files changed, 32 insertions, 0 deletions
diff --git a/cholerab/IRC-RPC b/cholerab/IRC-RPC
new file mode 100644
index 00000000..a5350534
--- /dev/null
+++ b/cholerab/IRC-RPC
@@ -0,0 +1,32 @@
+# Krebs IRC RPC
+
+ on :<from> PRIVMSG <target> :<handle>: <command> <argument>
+
+ if <handle> ∈ { nickname, "ALL" }
+ if <command> is a public command
+
+ path = $__public_command_directory/<command>
+ argv = []
+ envp = { from: <from>, argument: <argument> }
+
+ <code> = execve(path, argv, envp) → <stdout>, <stderr>
+
+ if <code> = 0
+ if <target> is channel
+ PRIVMSG <target> :<from>: <stdout>
+ PRIVMSG <from> :<stderr>
+ else
+ ; TODO assert <target> = <from>
+ PRIVMSG <from> :<stdout>
+ PRIVMSG <from> :Error: <stderr>
+ else
+
+ send all <.*> to the Ministerium
+
+ if <target> is channel
+ PRIVMSG <target> :<from>: <command> is broken ATM
+ else
+ PRIVMSG <target> :Error: <command> is broken ATM
+
+ else
+ PRIVMSG <target> :<from>: you are made of stupid