kerlossal_python/kerlossal.py
2025-02-23 06:09:41 +00:00

26 lines
679 B
Python
Executable File

from botclient.botclient import Bot
import subprocess
class Kerlossal(Bot):
def artwork(self):
cmd = [ self.cf['exe'], self.cf['data'] ]
if 'max_length' in self.cf:
cmd.append(str(self.cf['max_length']))
result = subprocess.check_output(cmd)
return result[:-1]
if __name__ == '__main__':
k = Kerlossal()
k.configure()
status = k.artwork()
status = status.decode("utf-8")
if status:
k.wait()
options = {}
if 'content_warning' in k.cf:
options['spoiler_text'] = k.cf['content_warning']
k.post(status, options)
else:
print("Something went wrong")