-
Notifications
You must be signed in to change notification settings - Fork 269
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
Send proactive message without saving Conversation reference #1934
Labels
feature-request
A request for new functionality or an enhancement to an existing one.
needs-triage
The issue has just been created and it has not been reviewed by the team.
Comments
ydmztang
added
feature-request
A request for new functionality or an enhancement to an existing one.
needs-triage
The issue has just been created and it has not been reviewed by the team.
labels
Apr 22, 2022
the following snippet works for me to send proactive messages to the user: config = DefaultConfig()
adapter = CloudAdapter(ConfigurationBotFrameworkAuthentication(config))
recipient = ChannelAccount(id=${aadObjectId})
bot = ChannelAccount(id=config.APP_ID)
activity_reply = Activity(
type=ActivityTypes.message,
channel_id="msteams",
from_property=bot,
recipient=recipient,
text="Hello!",
)
conversation_params = ConversationParameters(
bot=bot,
members=[recipient],
activity=activity_reply,
channel_data={"tenant": {"id": "${tenantID}"}},
)
await adapter.create_conversation(
bot_app_id=config.APP_ID,
callback=lambda turn_context: turn_context.send_activity(activity_reply),
conversation_parameters=conversation_params,
channel_id="msteams",
service_url="https://smba.trafficmanager.net/teams/",
) |
@kostyaplis This is probably just for Teams? |
Yes, for Teams |
@kostyaplis |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
feature-request
A request for new functionality or an enhancement to an existing one.
needs-triage
The issue has just been created and it has not been reviewed by the team.
Is your feature request related to a problem? Please describe.
We are trying to build some automation and send messages as a bot. For example, the github PR is open for too long, send bot message to the reviewer.
I see this example to cache the conversation reference: https://github.com/microsoft/BotBuilder-Samples/blob/main/samples/python/16.proactive-messages/bots/proactive_bot.py#L10
However, this implementation just isn't resilient. E.g., what if my bot server crashed, how to I keep the conversation references? We can certainly build something to make it fault tolerant, but that adds unnecessary complexity.
In fact, we do have the user id, but we can't construct a conversation reference from solely the user id + bot id.
Describe the solution you'd like
I'd like to have the Bot framework support creating/retrieving conversation reference on the fly given the user id. E.g.,
conversation_reference = ConversationReference(user_id=user_id, ...)
Describe alternatives you've considered
This API seems to be promising: https://docs.microsoft.com/en-us/graph/api/userscopeteamsappinstallation-get-chat?view=graph-rest-1.0&tabs=http
However, I can't get the accessToken from the SDK (it requires the TurnContext, which is again a problem for proactive scenarios)
Additional context
The text was updated successfully, but these errors were encountered: