|
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 | 13 |
|
15 | 14 | async def _get_requested_mentor(requested_mentor: Optional[str], slack: SlackAPI, |
16 | 15 | airtable: AirtableAPI) -> Optional[str]: |
@@ -49,17 +48,17 @@ def _create_messages(mentors: List[str], request: dict, requested_mentor_message |
49 | 48 | 'text': mentor_request_text(slack_id, service_translation, request.get('skillsets', None), |
50 | 49 | requested_mentor_message), |
51 | 50 | 'attachments': claim_mentee_attachment(request['record']), |
52 | | - 'channel': MENTORS_CHANNEL |
| 51 | + 'channel': MENTOR_CHANNEL |
53 | 52 | } |
54 | 53 |
|
55 | 54 | details_message = { |
56 | 55 | 'text': f"Additional details: {request.get('details', 'None Given')}", |
57 | | - 'channel': MENTORS_CHANNEL |
| 56 | + 'channel': MENTOR_CHANNEL |
58 | 57 | } |
59 | 58 |
|
60 | 59 | matching_mentors_message = { |
61 | 60 | 'text': "Mentors matching all or some of the requested skillsets: " + ' '.join(mentors), |
62 | | - 'channel': MENTORS_CHANNEL |
| 61 | + 'channel': MENTOR_CHANNEL |
63 | 62 | } |
64 | 63 |
|
65 | 64 | return first_message, details_message, matching_mentors_message |
|
0 commit comments