|
7 | 7 | from slack.exceptions import SlackAPIError |
8 | 8 | from slack.io.aiohttp import SlackAPI |
9 | 9 | from pybot.plugins.airtable.api import AirtableAPI |
| 10 | +from pybot.endpoints.slack.utils import MENTOR_CHANNEL |
10 | 11 | from .message_templates.messages import claim_mentee_attachment, mentor_request_text |
11 | 12 |
|
12 | | -MENTORS_CHANNEL = os.environ.get("MENTORS_CHANNEL") or "G1DRT62UC" |
13 | | - |
14 | | - |
15 | 13 | async def _get_requested_mentor(requested_mentor: Optional[str], slack: SlackAPI, |
16 | 14 | airtable: AirtableAPI) -> Optional[str]: |
17 | 15 | try: |
@@ -49,17 +47,17 @@ def _create_messages(mentors: List[str], request: dict, requested_mentor_message |
49 | 47 | 'text': mentor_request_text(slack_id, service_translation, request.get('skillsets', None), |
50 | 48 | requested_mentor_message), |
51 | 49 | 'attachments': claim_mentee_attachment(request['record']), |
52 | | - 'channel': MENTORS_CHANNEL |
| 50 | + 'channel': MENTOR_CHANNEL |
53 | 51 | } |
54 | 52 |
|
55 | 53 | details_message = { |
56 | 54 | 'text': f"Additional details: {request.get('details', 'None Given')}", |
57 | | - 'channel': MENTORS_CHANNEL |
| 55 | + 'channel': MENTOR_CHANNEL |
58 | 56 | } |
59 | 57 |
|
60 | 58 | matching_mentors_message = { |
61 | 59 | 'text': "Mentors matching all or some of the requested skillsets: " + ' '.join(mentors), |
62 | | - 'channel': MENTORS_CHANNEL |
| 60 | + 'channel': MENTOR_CHANNEL |
63 | 61 | } |
64 | 62 |
|
65 | 63 | return first_message, details_message, matching_mentors_message |
|
0 commit comments