From 73d8b4e94cfada3c250185b1e195089edb61fd4d Mon Sep 17 00:00:00 2001 From: hekel Date: Sat, 9 Mar 2019 01:14:21 -0500 Subject: [PATCH] Replace pastebin service for help ptpb.pw has shutdown ptpb/pb#245 ptpb/pb#240 --- sopel/modules/help.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sopel/modules/help.py b/sopel/modules/help.py index b491097db8..5c3811ff74 100644 --- a/sopel/modules/help.py +++ b/sopel/modules/help.py @@ -82,21 +82,20 @@ def help(bot, trigger): def create_list(bot, msg): msg = 'Command listing for {}@{}\n\n'.format(bot.nick, bot.config.core.host) + msg - payload = {"content": msg} - headers = {'Content-type': 'application/json', 'Accept': 'application/json'} try: - result = requests.post('https://ptpb.pw/', json=payload, headers=headers) + result = requests.post('https://clbin.com/', data={'clbin': msg}) except requests.RequestException: bot.say("Sorry! Something went wrong.") logger.exception("Error posting commands") return - result = result.json() - if 'url' not in result: + result = result.text + if "https://clbin.com/" in result: + return result + else: bot.say("Sorry! Something went wrong.") logger.error("Invalid result %s", result) return - return result['url'] @rule('$nick' r'(?i)help(?:[?!]+)?$')