diff --git a/LittleShop/Areas/Admin/Controllers/BotsController.cs b/LittleShop/Areas/Admin/Controllers/BotsController.cs index 51e0440..8ffc0ff 100644 --- a/LittleShop/Areas/Admin/Controllers/BotsController.cs +++ b/LittleShop/Areas/Admin/Controllers/BotsController.cs @@ -350,6 +350,23 @@ public class BotsController : Controller return RedirectToAction(nameof(Details), new { id }); } + // GET: Admin/Bots/ShareCard/5 + public async Task ShareCard(Guid id) + { + var bot = await _botService.GetBotByIdAsync(id); + if (bot == null) + return NotFound(); + + // Build the tg.me link + var telegramLink = !string.IsNullOrEmpty(bot.PlatformUsername) + ? $"https://t.me/{bot.PlatformUsername}" + : null; + + ViewData["TelegramLink"] = telegramLink; + + return View(bot); + } + private string GenerateBotFatherCommands(BotWizardDto dto) { var commands = new List diff --git a/LittleShop/Areas/Admin/Views/Bots/Details.cshtml b/LittleShop/Areas/Admin/Views/Bots/Details.cshtml index c3b8627..68a8677 100644 --- a/LittleShop/Areas/Admin/Views/Bots/Details.cshtml +++ b/LittleShop/Areas/Admin/Views/Bots/Details.cshtml @@ -306,7 +306,10 @@ View Detailed Metrics - + + Share Bot + + @if (Model.Status == LittleShop.Enums.BotStatus.Active) {
diff --git a/LittleShop/Areas/Admin/Views/Bots/ShareCard.cshtml b/LittleShop/Areas/Admin/Views/Bots/ShareCard.cshtml new file mode 100644 index 0000000..f0064f4 --- /dev/null +++ b/LittleShop/Areas/Admin/Views/Bots/ShareCard.cshtml @@ -0,0 +1,336 @@ +@model LittleShop.Models.Bot +@using LittleShop.Enums +@{ + ViewData["Title"] = "Share Bot"; + Layout = "_Layout"; + var telegramLink = ViewData["TelegramLink"] as string; + var hasLink = !string.IsNullOrEmpty(telegramLink); +} + + + +
+
+
+ +
+
+ +
+
+ + + +
+
+
+ +@section Scripts { + + +}