Microsoft bot framework getting the users time zone

China☆狼群 提交于 2019-12-06 06:18:43

问题


I have a use case when my bot needs to send users a message at a specific time of the day. Let's say at 6am every morning.

I am using a scheduled azure Webjob to send these messages. The messages would be delivered in Slack and Skype clients.

However I might have users in different time zones, which means I need to be able to send the messages at 6am at the users (Slack's or Skype's) time zone.

How can I find out within the bot framework of what the end user's time zone is?

The Activity.Timezone is in utc, and I cannot find any other method/property that represents the clients timezone setting.

Thank you


回答1:


Most of the channels does not provide that information to the BotBuilder. However, if the location data is available, it will be likely returned in the channel's native format in the ChannelData field.

Have in mind that the user needs to allow sending that data.

This was discussed a few times in the BotBuilder repository:

  • Is there a way to identify timezone of the user?
  • Skypebot: how to get sender timezone?


来源:https://stackoverflow.com/questions/40011998/microsoft-bot-framework-getting-the-users-time-zone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!