Sep 26 2023 03:47 AM
Can we send messages with smiley from a teams channel to direct line using the connector client
Sep 26 2023 06:26 AM
Hi @Lakshmi_145,
you can send messages with smiley from a Teams channel to Direct Line using the connector client.
Here are the steps:
Here is an example of how to send a message with a smiley from a Teams channel to Direct Line using the Python connector client library:
import teamsconnectorclient
# Create a new instance of the Teams connector client.
client = teamsconnectorclient.TeamsConnectorClient()
# Connect to the Teams channel where you want to send the message.
client.connect_to_channel('channel-id')
# Create a new message object.
message = teamsconnectorclient.Message()
# Set the text of the message to "hi xyz 😊".
message.text = 'hi xyz 😊'
# Send the message.
client.send_message(message)
You will need to replace channel-id with the ID of the Teams channel where you want to send the message.
You can also use the Teams connector client to send messages with other types of attachments, such as images, videos, and files.
here are some links to help you learn more about sending messages with smiley from Teams to Direct Line using the connector client:
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.
If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic
(LinkedIn)
Sep 26 2023 08:25 AM - edited Sep 26 2023 08:26 AM
Thanks for the response.
I have tried the same by giving the text as the activity.attachment content which we get from sender in c#.
It worked for teams to teams but didnt worked for teams to directline
Sep 26 2023 11:57 PM
Hi @Lakshmi_145,
The Teams connector client library may be converting the smiley to a different format when sending it to Direct Line.
One possible workaround would be to send the smiley as a Unicode character instead of as a smiley emoji.
For example, you can use the Unicode code point for the smiling face emoji (U+1F604) like this:
message.text = "hi xyz \U0001F604";
Make sure to set the message's text field with the Unicode code point for the emoji you want to include.
*If you still encounter issues with smileys not displaying correctly in Direct Line despite encoding them properly, it might be worth checking if Direct Line has specific requirements or limitations regarding emoji display. You can refer to the Direct Line documentation or seek support from the Direct Line team for further assistance with emoji handling in your specific scenario.
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.
If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic
(LinkedIn)