Skip to content

Commit

Permalink
Revert "feat(admin): add admin-only commands for bot configuration"
Browse files Browse the repository at this point in the history
This reverts commit 7896706.
  • Loading branch information
phoenixpereira committed Nov 13, 2024
1 parent 222c1aa commit 74d271f
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 146 deletions.
2 changes: 0 additions & 2 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ TENOR_API_KEY="TENOR_API_KEY"
GEMINI_API_KEY="GEMINI_API_KEY"
REQUESTS_PER_MINUTE=3
LIMIT_WINDOW=60
ADMIN_USERS=User1,User2,User3

128 changes: 0 additions & 128 deletions src/commands/admin_commands.py

This file was deleted.

12 changes: 0 additions & 12 deletions src/commands/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,18 +347,6 @@ async def query(

return response_embeds

def clear_chat_history(self):
"""Clears all conversation history for the chat context."""
try:
# Clear the stored chat history if maintained within self.chat
if hasattr(self, "chat"):
self.chat.history = []
logging.info("Gemini chat history has been successfully reset.")
else:
logging.warning("No chat history found to clear.")
except Exception as e:
logging.error(f"Error while resetting Gemini chat history: {e}")


async def upload_or_return_file_ref(attachment) -> (File, Errors):
"""Uploads the image to the Google Gemini Project
Expand Down
5 changes: 1 addition & 4 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from dotenv import load_dotenv

from constants.colours import LIGHT_YELLOW
from commands import gemini, skullboard, help_menu, admin_commands
from commands import gemini, skullboard, help_menu
from utils import time

# Load environment variables from .env file
Expand Down Expand Up @@ -69,9 +69,6 @@ def __init__(self):
api_key=GEMINI_API_KEY,
)

self.admin_commands = admin_commands.AdminCommands(gemini_bot=self.gemini_model)
self.tree.add_command(self.admin_commands, guild=Object(GUILD_ID))

async def setup_hook(self):
# Dynamically load all command groups from the commands directory
for _, module_name, _ in pkgutil.iter_modules(["src/commands"]):
Expand Down

0 comments on commit 74d271f

Please sign in to comment.