Initial KV API concept

This commit is contained in:
Kruzya
2023-01-05 08:01:18 +03:00
parent a97fac85e4
commit 984e582ce4
8 changed files with 207 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
using Telegram.Bot.Types;
namespace Kruzya.TelegramBot.Core.Option;
public class OptionKey : IOptionKey
{
public long ChatId { get; }
public long? UserId { get; } = null;
public string Identifier { get; }
public OptionKey(Chat chat, User user, string identifier) : this(chat.Id, user.Id, identifier)
{}
public OptionKey(Chat chat, string identifier) : this(chat.Id, null, identifier)
{}
public OptionKey(long chat, string identifier) : this(chat, null, identifier)
{}
public OptionKey(long chat, long? user, string identifier)
{
ChatId = chat;
UserId = user;
Identifier = identifier;
}
}