Update SessionBase.cs
- adding method to get User Sessions and Group Sessions
This commit is contained in:
parent
f80fda8ff9
commit
54176f9136
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user