def start_onboarding(user_id: str, user_name: str, real_name: str,
                     channel: str):
    onboarding_tutorial = OnboardingTutorial(user_id, user_name, real_name,
                                             channel)
    message = onboarding_tutorial.get_message_payload()
    response = slack_web_client.chat_postMessage(**message)
    onboarding_tutorial.timestamp = response['ts']
    hyeonMsgSentItem = getDynamo_hyeonMsgSentItem(channel,
                                                  dynamodbTb_hyeonmsgsent)
    if not hyeonMsgSentItem or channel not in hyeonMsgSentItem['channel']:
        putDynamo_hyeonOperation(channel,
                                 user_id=user_id,
                                 payload=onboarding_tutorial)
Exemplo n.º 2
0
def start_onboarding(user_id: str, channel: str):
    # Create a new onboarding tutorial.
    onboarding_tutorial = OnboardingTutorial(channel)
    # Get the onboarding message payload
    message = onboarding_tutorial.get_message_payload()
    # Post the onboarding message in Slack
    response = slack_web_client.chat_postMessage(**message)
    # Capture the timestamp of the message we've just posted so
    # we can use it to update the message after a user
    # has completed an onboarding task.
    onboarding_tutorial.timestamp = response["ts"]
    # Store the message sent in onboarding_tutorials_sent
    if channel not in onboarding_tutorials_sent:
	    onboarding_tutorials_sent[channel] = {}
	    onboarding_tutorials_sent[channel][user_id] = onboarding_tutorial
Exemplo n.º 3
0
def start_onboarding(user_id: str, channel: str):
    # Create a new onboarding tutorial.
    onboarding_tutorial = OnboardingTutorial(channel)

    # Get the onboarding message payload
    message = onboarding_tutorial.get_message_payload()

    # Post the onboarding message in Slack
    response = slack_web_client.chat_postMessage(**message)

    # Update the timestamp
    onboarding_tutorial.timestamp = response["ts"]

    # Store the message sent in onboarding_tutorials_sent
    if channel not in onboarding_tutorials_sent:
        onboarding_tutorials_sent[channel] = {}
    onboarding_tutorials_sent[channel][user_id] = onboarding_tutorial
Exemplo n.º 4
0
async def start_onboarding(web_client: slack.WebClient, user_id: str, channel: str):
    # Create a new onboarding tutorial.
    onboarding_tutorial = OnboardingTutorial(channel)

    # Get the onboarding message payload
    message = onboarding_tutorial.get_message_payload()

    # Post the onboarding message in Slack
    response = await web_client.chat_postMessage(**message)

    # Capture the timestamp of the message we've just posted so
    # we can use it to update the message after a user
    # has completed an onboarding task.
    onboarding_tutorial.timestamp = response["ts"]

    # Store the message sent in onboarding_tutorials_sent
    if channel not in onboarding_tutorials_sent:
        onboarding_tutorials_sent[channel] = {}
    onboarding_tutorials_sent[channel][user_id] = onboarding_tutorial
Exemplo n.º 5
0
    def start_onboardings(user_id: str, channel: str):

        onboarding_tutorial = OnboardingTutorial(channel)

        message = {
            'channel':
            "C018BA3SERK",
            'blocks': [{
                'type': 'section',
                'text': {
                    'type': 'mrkdwn',
                    'text':
                    f'@here\na new channel: #{channel_name} was created!'
                }
            }]
        }
        response = slack_web_client.chat_postMessage(**message)

        onboarding_tutorial.timestamp = response["ts"]

        if channel not in onboarding_tutorials_sent:
            onboarding_tutorials_sent[channel] = {}
        onboarding_tutorials_sent[channel][user_id] = onboarding_tutorial