[entertainment] add guess game

This commit is contained in:
Andriy
2023-01-18 02:07:48 +02:00
parent c61d875a6a
commit ec11cf4496
5 changed files with 145 additions and 1 deletions
+11
View File
@@ -72,6 +72,17 @@ namespace Kruzya.TelegramBot.Core.Cache
return true;
}
public TValue GetOr(TKey key, TValue defValue = default)
{
var doesExist = TryGetValue(key, out var value);
if (!doesExist)
{
value = defValue;
}
return value;
}
public void SetValue(TKey key, TValue value)
{
SetValue(key, value, _defaultTtl);