Skip to content

Commit

Permalink
Merge pull request #106 from teknologi-umum/gemini
Browse files Browse the repository at this point in the history
Update privilege regarding Gemini usage
  • Loading branch information
ronnygunawan authored Jan 31, 2024
2 parents 09976d3 + f027e7e commit abd0549
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion BotNet.CommandHandlers/AI/Gemini/GeminiTextPromptHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -29,7 +30,8 @@ ILogger<GeminiTextPromptHandler> logger
private readonly ILogger<GeminiTextPromptHandler> _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."),
Expand Down
8 changes: 4 additions & 4 deletions BotNet.CommandHandlers/Privilege/PrivilegeCommandHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
""",
Expand Down Expand Up @@ -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
Expand All @@ -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
""",
Expand All @@ -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
""",
Expand Down

0 comments on commit abd0549

Please sign in to comment.