Skip to content

Commit c130ef2

Browse files
committed
cleanup configs
1 parent 0d0ac93 commit c130ef2

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

docker/example.env

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
# --------------------------- #
22
### pybot.env ###
33

4-
# TOKEN=
5-
# BOT_OATH_TOKEN=
6-
# SLACK_BOT_SIGNING_SECRET=
7-
# VERIFICATION_TOKEN=
8-
# SLACK_BOT_ID=
9-
# SLACK_BOT_USER_ID=
4+
# BOT_OAUTH_TOKEN=<Bot User OAuth Access Token>
5+
# SLACK_BOT_SIGNING_SECRET=<Client Secret>
6+
# VERIFICATION_TOKEN=<Verification Token>
7+
# SLACK_BOT_ID=<Not necessary in many cases, see the below warning>
108

11-
# PYBACK_PORT=
12-
# PYBACK_HOST=
9+
##~~ "`SLACK_BOT_USER_ID` not set. It is required for `on mention` routing and discarding "
10+
##~~ "message coming from Sir Bot-a-lot to avoid loops."
1311

12+
13+
#~~ These are only needed if you want to override the default channel names ~~#
1414
# COMMUNITY_CHANNEL=
1515
# MENTOR_CHANNEL=
1616
# TICKET_CHANNEL=
1717

1818
# AIRTABLE_API_KEY=
1919
# AIRTABLE_BASE_KEY=
2020

21-
# PYBACK_TOKEN=
2221

2322
# --------------------------- #
2423
### ngrok.env ###

pybot/__main__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
bot.load_plugin(slack)
4343

4444
admin_configs = dict(**slack_configs)
45-
admin_configs["token"] = os.environ.get("APP_ADMIN_OAUTH_TOKEN")
45+
admin_token = os.environ.get("APP_ADMIN_OAUTH_TOKEN")
46+
if admin_token:
47+
admin_configs["token"] = admin_token
4648
admin_slack = SlackPlugin(**admin_configs)
4749
bot.load_plugin(admin_slack, name="admin_slack")
4850

pybot/endpoints/slack/utils/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
COMMUNITY_CHANNEL = os.environ.get("COMMUNITY_CHANNEL") or "greetings"
55
MODERATOR_CHANNEL = os.environ.get("MODERATOR_CHANNEL") or "moderators"
66
TICKET_CHANNEL = os.environ.get("TICKET_CHANNEL") or "oc-project-leads"
7-
APP_TOKEN = os.environ.get("APP_TOKEN") or "123"
87
YELP_TOKEN = os.environ.get("YELP_TOKEN") or "token"
9-
PYBACK_HOST = os.environ.get("PYBACK_HOST") or "pyback"
10-
PYBACK_PORT = os.environ.get("PYBACK_PORT") or 8000
11-
PYBACK_TOKEN = os.environ.get("PYBACK_TOKEN") or "token"
128
PORT = os.environ.get("SIRBOT_PORT", 5000)
139
HOST = os.environ.get("SIRBOT_ADDR", "0.0.0.0")
1410
PYBOT_ENV = os.environ.get("PYBOT_ENV", "dev")
@@ -19,7 +15,10 @@
1915
BOT_URL = "https://github.com/OperationCode/operationcode-pybot"
2016

2117
slack_configs = {
22-
"token": os.environ.get("BOT_OATH_TOKEN"),
18+
"token": os.environ.get(
19+
"BOT_OAUTH_TOKEN",
20+
os.environ.get('BOT_OATH_TOKEN') # fallback using old typo value
21+
),
2322
"signing_secret": os.environ.get("SLACK_BOT_SIGNING_SECRET"),
2423
"verify": os.environ.get("VERIFICATION_TOKEN"),
2524
"bot_id": os.environ.get("SLACK_BOT_ID"),

0 commit comments

Comments
 (0)