-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(channels): add conversation.started event #266
Conversation
DEV-1623 Content of proactive messages should not be handled by messaging
We should send a requests to our webhooks instead to inform them that a conversation has started and let them decide what message to send to the user |
if (started) { | ||
await this.app.stream.stream( | ||
'conversation.started', | ||
{ conversationId, channel: channel.name }, | ||
clientId, | ||
userId, | ||
{ | ||
conduit: { id: this.conduitId, endpoint } | ||
} | ||
) | ||
} else { | ||
return this.app.messages.create(conversationId, userId, endpoint.content, { | ||
conduit: { id: this.conduitId, endpoint: _.omit(endpoint, 'content') } | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the cleanest implementation. Channels are going to be refactored when they are moved to their own package and this is going to be way better
@laurentlp Should we consider the /start command to be a proactive message? This might break users. We could make this change in the v2 version of the channel Here the bot would not respond for example and you would need to send another message. The thing is that the /start command is sent automatically when you start a conversation, so it is sort of a proactive trigger |
@@ -72,6 +72,8 @@ export class TeamsConduit extends ConduitInstance<TeamsConfig, TeamsContext> { | |||
await turnContext.sendActivity(message) | |||
}) | |||
} | |||
|
|||
await this.receive(turnContext, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We send the event after sending the proactive message to teams?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proactive message implementation above is a legacy implementation. The new way of doing this is receiving the proactive trigger in botpress and sending a message. We keep the old one as well to avoid breaking people's stuff.
I think we have to in order to support proactive messages on Telegram. Since we don't have access to any other hook telling us that a user created a new conversation with a given bot, we should use the Also, is my understanding of this feature correct? We would receive a |
@laurentlp Rigth now we treat /start as a text message containing |
Adds a conversation.started event that allows sending a proactive message
Closes DEV-1623
Closes DEV-2070