Skip to content

Commit

Permalink
Replace pastebin service for help
Browse files Browse the repository at this point in the history
ptpb.pw has shutdown
ptpb/pb#245
ptpb/pb#240
  • Loading branch information
hekel authored and kwaaak committed Mar 25, 2019
1 parent a9d8753 commit 5c50cb6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions sopel/modules/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(?:[?!]+)?$')
Expand Down

0 comments on commit 5c50cb6

Please sign in to comment.