amightyhost_python/amightyhost.py
2025-02-23 06:10:11 +00:00

28 lines
689 B
Python
Executable File

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