Files
telegram-bot/modules/ContentStore/Model/StoreItem.cs
T

27 lines
616 B
C#
Raw Normal View History

2022-02-16 17:07:30 +02:00
using Telegram.Bot.Types.ReplyMarkups;
namespace West.TelegramBot.ContentStore.Model;
2022-02-16 18:08:02 +02:00
public class StoreItem
2022-02-16 17:07:30 +02:00
{
public string Id;
public readonly string Name;
public readonly double Price;
public readonly int Order;
2022-02-16 17:07:30 +02:00
public StoreItem(string id, string name, double price, int order = 0)
2022-02-16 17:07:30 +02:00
{
Id = id;
Name = name;
Price = price;
Order = order;
2022-02-16 17:07:30 +02:00
}
public InlineKeyboardButton ToButton(long userId)
{
return new InlineKeyboardButton($"{Name} ({Price})")
{
CallbackData = $"store|{userId}|purchase|{Id}"
};
}
}