Skip to content

Commit 4d90c23

Browse files
author
wimo7083
committed
update and consolidate env vars
1 parent fa4214b commit 4d90c23

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

pybot/endpoints/airtable/utils.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
from slack.exceptions import SlackAPIError
88
from slack.io.aiohttp import SlackAPI
99
from pybot.plugins.airtable.api import AirtableAPI
10+
from pybot.endpoints.slack.utils import MENTOR_CHANNEL
1011
from .message_templates.messages import claim_mentee_attachment, mentor_request_text
1112

12-
MENTORS_CHANNEL = os.environ.get("MENTORS_CHANNEL") or "G1DRT62UC"
13-
1413

1514
async def _get_requested_mentor(requested_mentor: Optional[str], slack: SlackAPI,
1615
airtable: AirtableAPI) -> Optional[str]:
@@ -49,17 +48,17 @@ def _create_messages(mentors: List[str], request: dict, requested_mentor_message
4948
'text': mentor_request_text(slack_id, service_translation, request.get('skillsets', None),
5049
requested_mentor_message),
5150
'attachments': claim_mentee_attachment(request['record']),
52-
'channel': MENTORS_CHANNEL
51+
'channel': MENTOR_CHANNEL
5352
}
5453

5554
details_message = {
5655
'text': f"Additional details: {request.get('details', 'None Given')}",
57-
'channel': MENTORS_CHANNEL
56+
'channel': MENTOR_CHANNEL
5857
}
5958

6059
matching_mentors_message = {
6160
'text': "Mentors matching all or some of the requested skillsets: " + ' '.join(mentors),
62-
'channel': MENTORS_CHANNEL
61+
'channel': MENTOR_CHANNEL
6362
}
6463

6564
return first_message, details_message, matching_mentors_message

pybot/endpoints/slack/utils/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
load_dotenv()
66

7+
MENTOR_CHANNEL = os.environ.get("MENTOR_CHANNEL") or "G1DRT62UC"
78
COMMUNITY_CHANNEL = os.environ.get("COMMUNITY_CHANNEL") or "G12343"
89
MODERATOR_CHANNEL = os.environ.get('REPORT_CHANNEL') or 'G8NDRJJF9'
10+
TICKET_CHANNEL = os.environ.get('TICKET_CHANNEL') or 'G8NDRJJF9'
911
APP_TOKEN = os.environ.get('APP_TOKEN') or "123"
1012
YELP_TOKEN = os.environ.get('YELP_TOKEN') or 'token'
1113
PYBACK_HOST = os.environ.get('PYBACK_HOST') or 'pyback'
1214
PYBACK_PORT = os.environ.get('PYBACK_PORT') or 8000
13-
PYBACK_TOKEN = os.environ.get('PYBACK_TOKEN') or 'token'
15+
PYBACK_TOKEN = os.environ.get('PYBACK_TOKEN') or 'token'

0 commit comments

Comments
 (0)