Skip to content

Commit

Permalink
Allow anyone to run v!extensions + fix llama folder deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Starlii10 committed Oct 3, 2024
1 parent 4fb2185 commit 5cb382f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
11 changes: 2 additions & 9 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,16 +491,9 @@ async def reboot(ctx: commands.Context, pull_git: bool = False):
async def extensions(ctx: commands.Context):
"""
Displays Vivia's available extensions.
## Notes:
- Only the bot owner can use this command.
- TODO: Should everyone be able to use this command?
"""
if await bot.is_owner(ctx.author):
await ctx.send("Available extensions: \n- " + ("\n- ".join(viviatools.loaded_extensions)) if len(viviatools.loaded_extensions) > 0 else "No extensions loaded? Wait, what?!", ephemeral=True)
await ctx.send("Extensions that failed to load: \n- " + ("\n- ".join(viviatools.failed_extensions)) if len(viviatools.failed_extensions) > 0 else "No extensions failed to load!", ephemeral=True)
else:
await ctx.send(personalityMessage("nopermissions"), ephemeral=True)
await ctx.send("Available extensions: \n- " + ("\n- ".join(viviatools.loaded_extensions)) if len(viviatools.loaded_extensions) > 0 else "No extensions loaded? Wait, what?!", ephemeral=True)
await ctx.send("Extensions that failed to load: \n- " + ("\n- ".join(viviatools.failed_extensions)) if len(viviatools.failed_extensions) > 0 else "No extensions failed to load!", ephemeral=True)

# Run
while True:
Expand Down
7 changes: 2 additions & 5 deletions extras/viviallama.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import logging
import mimetypes
import os
import shutil
import sys
from PIL import Image
import cv2
Expand Down Expand Up @@ -56,11 +57,7 @@

# Delete tempchats folder if it exists
if os.path.exists("data/tempchats"):
# Just like the terminal title, VSCode hates when I do it like this. Too bad, I can't write cross-platform code very well
if sys.platform == "win32":
os.system("rmdir /S /Q data/tempchats") # Windows
else:
os.system("rm -rf data/tempchats") # Linux/Unix/Mac/Insert-Non-Windows-OS-Here
shutil.rmtree("data/tempchats")
viviatools.log("Deleted temporary chat files", logging.DEBUG)

# Load LLaMa
Expand Down

0 comments on commit 5cb382f

Please sign in to comment.