public static async Task ShowAlarms(ITurnContext context) { var userState = context.GetUserState <UserData>(); if (userState.Alarms == null) { userState.Alarms = new List <Alarm>(); } await ShowAlarmsTopicResponses.ReplyWithShowAlarms(context, userState.Alarms); }
public static Task ShowAlarms(IBotContext context) { var alarms = (List <Alarm>)context.State.UserProperties[UserProperties.ALARMS]; if (alarms == null) { alarms = new List <Alarm>(); context.State.UserProperties[UserProperties.ALARMS] = alarms; } ShowAlarmsTopicResponses.ReplyWithShowAlarms(context, alarms); return(Task.CompletedTask); }
public static Task ShowAlarms(IBotContext context) { var userState = context.GetUserState <UserData>(); // var userState = UserState<UserAlarms>.Get(context); if (userState.Alarms == null) { userState.Alarms = new List <Alarm>(); } ShowAlarmsTopicResponses.ReplyWithShowAlarms(context, userState.Alarms); return(Task.CompletedTask); }