3 from urllib.parse import parse_qs
4 from slack import WebClient
12 from types import SimpleNamespace
13 from google.auth.transport.requests import Request
14 from googleapiclient.discovery import build
16 # Note: Late import here to have the environment variable above available
18 if 'SLACK_BOT_TOKEN' in os.environ:
19 slack_bot_token = os.environ['SLACK_BOT_TOKEN']
21 print("Please set SLACK_BOT_TOKEN in environment variable")
23 slack_client = WebClient(slack_bot_token)
25 channel_id='C01K8FJJMR7'
26 puzzle_url="https://perpendicular.institute/puzzle/%E2%9C%8F/"
27 sheet_url='https://docs.google.com/spreadsheets/d/1951ZTGLvSq5PqHPQ1ygqddRjennsedkNtCaOGH__dMo/edit#gid=2097467701'
28 title="(See `/puzzle` for title)"
29 topic="(<{}|Puzzle>,<{}|Sheet>) {}".format(puzzle_url, sheet_url, title)
31 slack_client.conversations_setTopic(channel=channel_id,