From: Andrea Cornell Date: Wed, 2 Nov 2022 01:18:13 +0000 (-0400) Subject: joinbot tweaks X-Git-Tag: strikebot-0.0.7~9 X-Git-Url: https://jcornell.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=911b26866ba2669be8c4c0b70d99f8b229c76540;p=counting.git joinbot tweaks * do not use service name as PGSERVICE * mod PM template: don't pretend it can be processed automatically --- diff --git a/joinbot/joinbot/common.py b/joinbot/joinbot/common.py index 0e032d3..255eb34 100644 --- a/joinbot/joinbot/common.py +++ b/joinbot/joinbot/common.py @@ -4,6 +4,6 @@ import os service_name = os.environ.get('LIVEAUTOJOINSERVICE', 'autojoin') def connect_db(): - cn = psycopg2.connect("service={}".format(service_name)) + cn = psycopg2.connect("") cr = cn.cursor() return (cn, cr) diff --git a/joinbot/joinbot/web/__init__.py b/joinbot/joinbot/web/__init__.py index 6d0f74f..f31a6ce 100644 --- a/joinbot/joinbot/web/__init__.py +++ b/joinbot/joinbot/web/__init__.py @@ -25,11 +25,7 @@ def make_oauth_url(service_name, client_id, event, redirect_uri): def make_privatemessage_url(service_name, event): if event and re.match('[a-z0-9]{10,}$', event): - body = '''I would like to join this thread: https://www.reddit.com/live/{1} - -(If you send this message with the following line intact, you will be invited automatically if possible) - -/autojoin service {0} event {1}'''.format(service_name, event) + body = '''I would like to join this thread: https://www.reddit.com/live/{}'''.format(event) elif event: body = '''I would like to join this thread: {}'''.format(event) else: