[store] Basic content store implementation.

- Bump Telegram Bot Framework to 0.6.9-gf1e77653ff
This commit is contained in:
West14
2022-02-16 17:07:30 +02:00
parent 67d0e81953
commit e815deba58
15 changed files with 376 additions and 2 deletions
+7
View File
@@ -0,0 +1,7 @@
namespace West.TelegramBot.ContentStore.Model;
public class AnimalImage
{
public string Id { get; set; } = null!;
public string Url { get; set; } = null!;
}
+10
View File
@@ -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;
}
+18
View File
@@ -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;
}
+25
View File
@@ -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}"
};
}
}