Files

25 lines
547 B
C#
Raw Permalink 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 StoreItem(string id, string name, double price)
{
Id = id;
Name = name;
Price = price;
}
public InlineKeyboardButton ToButton(long userId)
{
return new InlineKeyboardButton($"{Name} ({Price})")
{
CallbackData = $"store|{userId}|purchase|{Id}"
};
}
}