Skip to content

Commit 0cfabe0

Browse files
author
wimo7083
committed
consolidate more env vars
1 parent 4d90c23 commit 0cfabe0

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

pybot/__main__.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,12 @@
1111

1212
from . import endpoints
1313
from .plugins import AirtablePlugin
14+
from pybot.endpoints.slack.utils import PORT, HOST
15+
from pybot.endpoints.slack.utils import slack_configs
1416

15-
PORT = os.environ.get("SIRBOT_PORT", 5000)
16-
HOST = os.environ.get("SIRBOT_ADDR", "0.0.0.0")
17-
ACCESS_TOKEN = os.environ.get("OAUTH_ACCESS_TOKEN", "access token")
18-
VERIFICATION_TOKEN = os.environ.get("VERIFICATION_TOKEN ", "verification token")
1917
VERSION = "0.1.0"
2018
logger = logging.getLogger(__name__)
2119

22-
slack_configs = {
23-
'token': os.environ.get('BOT_OATH_TOKEN'),
24-
'verify': os.environ.get('VERIFICATION_TOKEN'),
25-
'bot_id': os.environ.get('SLACK_BOT_ID'),
26-
'bot_user_id': os.environ.get('SLACK_BOT_ID'),
27-
}
28-
2920

3021
def make_sentry_logger():
3122
client = raven.Client(

pybot/endpoints/slack/utils/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
load_dotenv()
66

7+
VERIFICATION_TOKEN = os.environ.get("VERIFICATION_TOKEN ", "verification token")
78
MENTOR_CHANNEL = os.environ.get("MENTOR_CHANNEL") or "G1DRT62UC"
89
COMMUNITY_CHANNEL = os.environ.get("COMMUNITY_CHANNEL") or "G12343"
910
MODERATOR_CHANNEL = os.environ.get('REPORT_CHANNEL') or 'G8NDRJJF9'
@@ -12,4 +13,13 @@
1213
YELP_TOKEN = os.environ.get('YELP_TOKEN') or 'token'
1314
PYBACK_HOST = os.environ.get('PYBACK_HOST') or 'pyback'
1415
PYBACK_PORT = os.environ.get('PYBACK_PORT') or 8000
15-
PYBACK_TOKEN = os.environ.get('PYBACK_TOKEN') or 'token'
16+
PYBACK_TOKEN = os.environ.get('PYBACK_TOKEN') or 'token'
17+
PORT = os.environ.get("SIRBOT_PORT", 5000)
18+
HOST = os.environ.get("SIRBOT_ADDR", "0.0.0.0")
19+
20+
slack_configs = {
21+
'token': os.environ.get('BOT_OATH_TOKEN'),
22+
'verify': os.environ.get('VERIFICATION_TOKEN'),
23+
'bot_id': os.environ.get('SLACK_BOT_ID'),
24+
'bot_user_id': os.environ.get('SLACK_BOT_ID'),
25+
}

0 commit comments

Comments
 (0)