From 911b26866ba2669be8c4c0b70d99f8b229c76540 Mon Sep 17 00:00:00 2001 From: Andrea Cornell Date: Tue, 1 Nov 2022 21:18:13 -0400 Subject: [PATCH] joinbot tweaks * do not use service name as PGSERVICE * mod PM template: don't pretend it can be processed automatically --- joinbot/joinbot/common.py | 2 +- joinbot/joinbot/web/__init__.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) 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: -- 2.30.2