diff --git a/README.md b/README.md index 6e7de50..2d2db37 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ How to use: -`!paste ` will paste text to your PrivateBin instance +`!paste ` will create a paste that expires in 24 hours + +`!bpaste ` will create a one-time paste + `!get #` will retrieve a given paste + `!echo ` will echo your message back diff --git a/pbbot.py b/pbbot.py index 1e206ad..2c6b9eb 100755 --- a/pbbot.py +++ b/pbbot.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys @@ -33,12 +33,12 @@ class PBBot(sleekxmpp.ClientXMPP): if msg['type'] in ('chat', 'normal'): if "!paste" in msg['body']: arg = msg['body'].replace('!paste', '').strip() - output = subprocess.check_output(['/bin/env', 'pbincli', \ + output = subprocess.check_output(['env', 'pbincli', \ 'send', '--text', arg]).decode('utf-8') msg.reply(output).send() elif "!bpaste" in msg['body']: arg = msg['body'].replace('!paste', '').strip() - output = subprocess.check_output(['/bin/env', 'pbincli', \ + output = subprocess.check_output(['env', 'pbincli', \ 'send', '-B', '--text', arg]).decode('utf-8') msg.reply(output).send() elif "!get" in msg['body']: @@ -50,7 +50,7 @@ class PBBot(sleekxmpp.ClientXMPP): arg = msg['body'].replace('!echo', '').strip() msg.reply("Thanks for sending\n" + arg).send() else: - msg.reply("Commands: paste echo get").send() + msg.reply("Commands (prefix with !): paste bpaste echo get").send() if __name__ == '__main__': # Setup the command line arguments.