mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
[store] Basic content store implementation.
- Bump Telegram Bot Framework to 0.6.9-gf1e77653ff
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
namespace West.TelegramBot.ContentStore.Model;
|
||||
|
||||
public class AnimalImage
|
||||
{
|
||||
public string Id { get; set; } = null!;
|
||||
public string Url { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace West.TelegramBot.ContentStore.Model;
|
||||
|
||||
public class OBoobsItem
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int Rank { get; set; }
|
||||
public string? Author { get; set; }
|
||||
public string? Model { get; set; }
|
||||
public string Preview { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using Telegram.Bot.Types;
|
||||
using Telegram.Bot.Types.Enums;
|
||||
|
||||
namespace West.TelegramBot.ContentStore.Model;
|
||||
|
||||
public class RandomMedia
|
||||
{
|
||||
public RandomMedia(string url, string? caption = null)
|
||||
{
|
||||
Url = url;
|
||||
Caption = caption;
|
||||
}
|
||||
|
||||
public string Url;
|
||||
public string? Caption;
|
||||
|
||||
public InputMediaType Type { get; set; } = InputMediaType.Photo;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Telegram.Bot.Types.ReplyMarkups;
|
||||
|
||||
namespace West.TelegramBot.ContentStore.Model;
|
||||
|
||||
class StoreItem
|
||||
{
|
||||
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}"
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user