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)
Ejemplo n.º 2
0
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 = 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

    message = onboarding_tutorial.get_message_payload()
    return thing()
Ejemplo n.º 3
0
def start_onboarding(user_id: str, channel_id: str):

    # create user and give a default poopable
    exists = db.session.query(
        db.exists().where(User.slack_user_id == user_id)).scalar()
    if not exists:
        user = User(slack_user_id=user_id)
        db.session.add(user)
        db.session.commit()

    # create on boarding tutorial and sent it to user
    onboarding_tutorial = OnboardingTutorial(channel_id)

    message = onboarding_tutorial.get_message_payload()

    response = slack_web_client.chat_postMessage(**message)
Ejemplo n.º 4
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
Ejemplo n.º 5
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