Skip to content
This repository was archived by the owner on Jul 2, 2019. It is now read-only.

Commit 3a916c3

Browse files
committed
Merge pull request BeepBoopHQ#1 from BeepBoopHQ/beepBoopPrep
make slackbot ready for beepBoop
2 parents a29f25b + 3bcf919 commit 3a916c3

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM python:2-onbuild
2+
3+
WORKDIR /usr/src/app
4+
5+
# use this to test a SLACK_TOKEN environment variable
6+
# ENV SLACK_TOKEN ###token###
7+
8+
RUN python run.py

slackbot/settings.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66
'slackbot.plugins',
77
]
88

9-
# API_TOKEN = '###token###'
9+
10+
try:
11+
# Raises a KeyError if SLACK_TOKEN environment variable is missing
12+
API_TOKEN = os.environ['SLACK_TOKEN']
13+
except:
14+
# Alternatively, place slack token in the source code
15+
# API_TOKEN = '###token###'
16+
print 'SLACK_TOKEN missing'
1017

1118
'''
1219
If you use Slack Web API to send messages (with send_webapi() or reply_webapi()),

0 commit comments

Comments
 (0)