botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
83 stars 91 forks source link

How to update name and profile pic in HITL #643

Closed JijeshP closed 5 years ago

JijeshP commented 5 years ago

What is the best way to update name and details in HITL session ?

image

rndlaine commented 5 years ago

You can use the user attributes picture_url to set a profile picture. You can use bp.users.updateAttributes to update the attributes. See https://botpress.io/reference/modules/_botpress_sdk_.users.html#updateattributes

JijeshP commented 5 years ago

@rndlaine but it's not reflecting in HITL module.
its reading the name and profile pic from HITL session. https://github.com/botpress/botpress/blob/master/modules/hitl/src/backend/db.ts#L47-L70

JijeshP commented 5 years ago

@rndlaine I have created a new action to resolve this issue..

knex('hitl_sessions') .where({ userId: event.target, botId: event.botId, channel: event.channel }).update({ full_name: full_name }).then(() => { console.log("Name updated");
});

rndlaine commented 5 years ago

@JijeshP yes indeed thats the quickest way to work around the issue.

I've created botpress/v12#647 to add this feature to HITL. Thanks for raising the issue!