Update SessionBase.cs

- adding method to get User Sessions and Group Sessions
This commit is contained in:
FlorianDahn 2020-04-05 23:47:27 +07:00
parent f80fda8ff9
commit 54176f9136

View File

@ -90,5 +90,22 @@ namespace TelegramBotBase
}
}
/// <summary>
/// Returns all active User Sessions.
/// </summary>
/// <returns></returns>
public List<DeviceSession> GetUserSessions()
{
return this.SessionList.Where(a => a.Key > 0).Select(a => a.Value).ToList();
}
/// <summary>
/// Returns all active Group Sessions.
/// </summary>
/// <returns></returns>
public List<DeviceSession> GetGroupSessions()
{
return this.SessionList.Where(a => a.Key < 0).Select(a => a.Value).ToList();
}
}
}