From f027e7eb0bc92dd32f103b44b94497bc875875cc Mon Sep 17 00:00:00 2001 From: Ronny Gunawan <3048897+ronnygunawan@users.noreply.github.com> Date: Thu, 1 Feb 2024 01:20:36 +0700 Subject: [PATCH] Update privilege regarding Gemini usage --- .../AI/Gemini/GeminiTextPromptHandler.cs | 4 +++- .../Privilege/PrivilegeCommandHandler.cs | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/BotNet.CommandHandlers/AI/Gemini/GeminiTextPromptHandler.cs b/BotNet.CommandHandlers/AI/Gemini/GeminiTextPromptHandler.cs index cec7729..76dd095 100644 --- a/BotNet.CommandHandlers/AI/Gemini/GeminiTextPromptHandler.cs +++ b/BotNet.CommandHandlers/AI/Gemini/GeminiTextPromptHandler.cs @@ -3,6 +3,7 @@ using BotNet.Commands.BotUpdate.Message; using BotNet.Commands.ChatAggregate; using BotNet.Commands.CommandPrioritization; +using BotNet.Commands.SenderAggregate; using BotNet.Services.Gemini; using BotNet.Services.Gemini.Models; using BotNet.Services.MarkdownV2; @@ -29,7 +30,8 @@ ILogger logger private readonly ILogger _logger = logger; public Task Handle(GeminiTextPrompt textPrompt, CancellationToken cancellationToken) { - if (textPrompt.Command.Chat is not HomeGroupChat) { + if (textPrompt.Command.Chat is not HomeGroupChat + && textPrompt.Command.Sender is not VIPSender) { return _telegramBotClient.SendTextMessageAsync( chatId: textPrompt.Command.Chat.Id, text: MarkdownV2Sanitizer.Sanitize("Gemini tidak bisa dipakai di sini."), diff --git a/BotNet.CommandHandlers/Privilege/PrivilegeCommandHandler.cs b/BotNet.CommandHandlers/Privilege/PrivilegeCommandHandler.cs index a34455c..5826bd8 100644 --- a/BotNet.CommandHandlers/Privilege/PrivilegeCommandHandler.cs +++ b/BotNet.CommandHandlers/Privilege/PrivilegeCommandHandler.cs @@ -33,7 +33,7 @@ await _telegramBotClient.SendTextMessageAsync( chatId: command.Chat.Id, text: $$""" 👑 Anda adalah user VIP (ID: {{command.Sender.Id}}) - 👑 GPT-4 tersedia + 👑 GPT-4, Gemini tersedia 👑 GPT-4 Vision tersedia 👑 DALL-E 3 tersedia """, @@ -61,7 +61,7 @@ await _telegramBotClient.SendTextMessageAsync( chatId: command.Chat.Id, text: $$""" 👑 Group {{command.Chat.Title}} (ID: {{command.Chat.Id}}) adalah home group - 👑 GPT-4 tersedia + 👑 GPT-4, Gemini tersedia 👑 GPT-4 Vision tersedia ✅ SDXL tersedia @@ -78,7 +78,7 @@ await _telegramBotClient.SendTextMessageAsync( chatId: command.Chat.Id, text: $$""" 👑 Group {{command.Chat.Title}} (ID: {{command.Chat.Id}}) adalah home group - 👑 GPT-4 tersedia + 👑 GPT-4, Gemini tersedia 👑 GPT-4 Vision tersedia ✅ SDXL tersedia """, @@ -97,7 +97,7 @@ await _telegramBotClient.SendTextMessageAsync( ❌ Image generation tidak tersedia 👑 Anda adalah user VIP - 👑 GPT-4 tersedia untuk Anda + 👑 GPT-4, Gemini tersedia untuk Anda 👑 GPT-4 Vision tersedia untuk Anda 👑 DALL-E 3 tersedia untuk Anda """,