Dec 08 2021 09:33 AM
Hi Team,
While users adding a bot in my MS Teams, we need to send a welcome card based on the Locale.
While the bot has been added to the user, OnMembersAddedAsync() has been triggered.
But string userLocale = turnContext.Activity.GetLocale(); is returning the null value. Could you please suggest, how to fix this issue?
Thanks in Advance!!!
Dec 08 2021 10:39 AM - edited Dec 09 2021 01:16 PM
Dec 08 2021 10:39 AM - edited Dec 09 2021 01:16 PM
Solution@maheshkumargunasekaran - As the bot activity is not initiated by the user action such as sending message. The bot doesn't received any locale information and this is by design and there is no fix for it. Once user sends a message or interact with the bot you can store this information for further interactions.
Also you can have default locale based on the area where application is being used.
Thanks,
Hunaid L Hanfee
------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
Dec 08 2021 10:39 AM - edited Dec 09 2021 01:16 PM
Dec 08 2021 10:39 AM - edited Dec 09 2021 01:16 PM
Solution@maheshkumargunasekaran - As the bot activity is not initiated by the user action such as sending message. The bot doesn't received any locale information and this is by design and there is no fix for it. Once user sends a message or interact with the bot you can store this information for further interactions.
Also you can have default locale based on the area where application is being used.
Thanks,
Hunaid L Hanfee
------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.