This repository has been archived on 2020-05-11. You can view files and clone it, but cannot push or open issues or pull requests.
minerbot2-older/utils.py

10 lines
383 B
Python

import plugin, subprocess
def register_command_call(command,cli,use_args=False,verify_args=lambda args: args):
@plugin.command(command)
def on_call(self,channel,nick,*args):
output = subprocess.check_output([cli]+list(verify_args(args) if use_args else [])).decode("utf-8").split("\n")
output = filter(None,output)
for line in output:
self.say(channel,"{}".format(line))