joinbot tweaks
authorAndrea Cornell <anders@acorn.pw>
Wed, 2 Nov 2022 01:18:13 +0000 (21:18 -0400)
committerAndrea Cornell <anders@acorn.pw>
Wed, 2 Nov 2022 01:22:49 +0000 (21:22 -0400)
* do not use service name as PGSERVICE
* mod PM template: don't pretend it can be processed automatically

joinbot/joinbot/common.py
joinbot/joinbot/web/__init__.py

index 0e032d31fae7f17e9c6a443f9b85a133fbc33081..255eb347dc643413f30ef3c19b794ff94291d246 100644 (file)
@@ -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)
index 6d0f74f2c04666197c4237d41f3ccdad7be26bf8..f31a6ced4f10c78b5c1f44027c05266d7507326c 100644 (file)
@@ -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: