Files

27 lines
616 B
C#

using Telegram.Bot.Types.ReplyMarkups;
namespace West.TelegramBot.ContentStore.Model;
public class StoreItem
{
public string Id;
public readonly string Name;
public readonly double Price;
public readonly int Order;
public StoreItem(string id, string name, double price, int order = 0)
{
Id = id;
Name = name;
Price = price;
Order = order;
}
public InlineKeyboardButton ToButton(long userId)
{
return new InlineKeyboardButton($"{Name} ({Price})")
{
CallbackData = $"store|{userId}|purchase|{Id}"
};
}
}