User profile data

Each messaging app or integration includes some basic information about your user that is stored in user scope. This provides some initial context about your user before they've interacted the first time.

# -*- coding: utf-8 -*-
from meya import Component


class UserProfileInformation(Component):

    def start(self):
        meya_user_id = self.db.user.id
        user_id = self.db.user.user_id # The integration-specific user ID
        integration = self.db.user.integration
        first_name = self.db.user.get('first_name')
        text = "Hello {}, you are using {} and your user id is {}".format(
            first_name, integration, user_id
        )
        message = self.create_message(text=text)
        return self.respond(message=message, action="next")
component: meya.text
properties:
	text: Hi {{ user.first_name }}!