juju/plugins/utilscore.py

11 lines
412 B
Python
Raw Normal View History

2023-06-26 15:31:30 +00:00
#!/usr/bin/python3
import pinhook.plugin
import util.tilde
import subprocess
@pinhook.plugin.command('&utilscore', ops=True, ops_msg='This command should only be used by ops', help_text='Shows how many tildecoins Util has')
def utilscore(msg):
bal = subprocess.check_output(['/home/jmjl/bin/coin','Util',f'-b{"d" if msg.arg else ""}']).decode('utf-8').split('\n')[0]
return pinhook.plugin.message(bal)