mod_bt.py

changeset 141
506e951fd338
parent 138
d0184734320e
child 146
c17b82b1f573
--- a/mod_bt.py	Sun May 17 20:40:09 2015 +0300
+++ b/mod_bt.py	Sun May 17 20:42:32 2015 +0300
@@ -51,6 +51,13 @@
 			'args': None,
 			'level': 'admin',
 		},
+		
+		{
+			'name': 'btsoap',
+			'description': 'Sends a custom SOAP query',
+			'args': '<func> [args...]',
+			'level': 'admin',
+		},
 	]
 }
 
@@ -61,4 +68,10 @@
 	Bt.announce_new_issue (bot, Bt.get_issue (args['ticket']))
 
 def cmd_checkbt (bot, **rest):
-	Bt.poll()
\ No newline at end of file
+	Bt.poll()
+
+def cmd_btsoap (bot, args, reply, **rest):
+	result = Bt.custom_query (args['func'], args['args'].split (' ') if 'args' in args else [])
+
+	for line in result.splitlines():
+		reply (line)
\ No newline at end of file

mercurial