From 723455d17a2a7ccd9b4497c6ed649fa73b1e7a7d Mon Sep 17 00:00:00 2001 From: "[Alien]" Date: Sun, 9 Feb 2020 01:15:28 +0200 Subject: [PATCH] Add help, bpaste without command --- pbbot.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pbbot.py b/pbbot.py index be0f8e1..f076828 100755 --- a/pbbot.py +++ b/pbbot.py @@ -49,8 +49,13 @@ class PBBot(sleekxmpp.ClientXMPP): elif "!echo" in msg['body']: arg = msg['body'].replace('!echo', '').strip() msg.reply("Thanks for sending\n" + arg).send() + elif "!help" in msg['body']: + msg.reply("Commands (prefix with !): help paste bpaste echo get").send() else: - msg.reply("Commands (prefix with !): paste bpaste echo get").send() + arg = msg['body'].strip() + output = subprocess.check_output(['env', 'pbincli', \ + 'send', '-B', '--text', arg]).decode('utf-8') + msg.reply(output).send() if __name__ == '__main__': # Setup the command line arguments.