mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
[store] Fix button order. Fix internal id for anim boobs.
This commit is contained in:
@@ -41,7 +41,8 @@ public class Store : BotEventHandler
|
||||
|
||||
var counter = 0;
|
||||
var list = new List<InlineKeyboardButton>();
|
||||
foreach (var item in _provider.GetServices<IRandomMediaService>())
|
||||
foreach (var item in _provider.GetServices<IRandomMediaService>()
|
||||
.OrderByDescending(s => s.StoreItem.Order))
|
||||
{
|
||||
var btn = item.StoreItem.ToButton(From.Id);
|
||||
if ((counter & 1) == 0) // 0 - even, 1 - odd
|
||||
|
||||
@@ -7,12 +7,14 @@ 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)
|
||||
public StoreItem(string id, string name, double price, int order = 0)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
Price = price;
|
||||
Order = order;
|
||||
}
|
||||
|
||||
public InlineKeyboardButton ToButton(long userId)
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace West.TelegramBot.ContentStore.Service;
|
||||
public class AnimBoobsService : IRandomMediaService
|
||||
{
|
||||
private readonly HttpClient _httpClient;
|
||||
public StoreItem StoreItem { get; } = new("boobs", "Сиськи движущиеся", 120);
|
||||
public StoreItem StoreItem { get; } = new("anim_boobs", "Сиськи движущиеся", 120, 40);
|
||||
|
||||
public AnimBoobsService()
|
||||
{
|
||||
|
||||
@@ -4,6 +4,6 @@ namespace West.TelegramBot.ContentStore.Service;
|
||||
|
||||
public class CatApiService : AnimalAsAService
|
||||
{
|
||||
public override StoreItem StoreItem { get; } = new("cat", "Котэ", 40);
|
||||
public override StoreItem StoreItem { get; } = new("cat", "Котэ", 40, 10);
|
||||
public CatApiService() : base(new Uri("https://api.thecatapi.com/v1/")) {}
|
||||
}
|
||||
@@ -4,6 +4,6 @@ namespace West.TelegramBot.ContentStore.Service;
|
||||
|
||||
public class DogApiService : AnimalAsAService
|
||||
{
|
||||
public override StoreItem StoreItem { get; } = new("dog", "Пёсель", 40);
|
||||
public override StoreItem StoreItem { get; } = new("dog", "Пёсель", 40, 20);
|
||||
public DogApiService() : base(new Uri("https://api.thedogapi.com/v1/")) {}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ namespace West.TelegramBot.ContentStore.Service;
|
||||
public class OBoobsService : IRandomMediaService
|
||||
{
|
||||
private readonly HttpClient _httpClient;
|
||||
public StoreItem StoreItem { get; } = new("boobs", "Сиськи", 60);
|
||||
public StoreItem StoreItem { get; } = new("boobs", "Сиськи", 60, 30);
|
||||
|
||||
public OBoobsService()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user