ksm
This commit is contained in:
parent
8af8c96210
commit
20d4d353d3
@ -276,7 +276,7 @@ async def send_discord_message_via_api(channel_id: int, content: str, timeout: f
|
|||||||
|
|
||||||
# Import dependencies after defining settings and constants
|
# Import dependencies after defining settings and constants
|
||||||
# Use absolute imports to avoid issues when running the server directly
|
# Use absolute imports to avoid issues when running the server directly
|
||||||
from discordbot.api_service import dependencies # type: ignore
|
from api_service import dependencies # type: ignore
|
||||||
from api_models import (
|
from api_models import (
|
||||||
Conversation,
|
Conversation,
|
||||||
UserSettings,
|
UserSettings,
|
||||||
@ -293,11 +293,11 @@ if discordbot_path not in sys.path:
|
|||||||
sys.path.insert(0, discordbot_path)
|
sys.path.insert(0, discordbot_path)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from discordbot import settings_manager # type: ignore # type: ignore
|
import settings_manager # type: ignore # type: ignore
|
||||||
from global_bot_accessor import get_bot_instance
|
from global_bot_accessor import get_bot_instance
|
||||||
log.info("Successfully imported settings_manager module and get_bot_instance")
|
log.info("Successfully imported settings_manager module and get_bot_instance")
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
log.error(f"Could not import discordbot.settings_manager or get_bot_instance: {e}")
|
log.error(f"Could not import settings_manager or get_bot_instance: {e}")
|
||||||
log.error("Ensure the API is run from the project root or discordbot is in PYTHONPATH.")
|
log.error("Ensure the API is run from the project root or discordbot is in PYTHONPATH.")
|
||||||
settings_manager = None # Set to None to indicate failure
|
settings_manager = None # Set to None to indicate failure
|
||||||
|
|
||||||
@ -461,7 +461,7 @@ dashboard_api_app = FastAPI(
|
|||||||
# Import dashboard API endpoints
|
# Import dashboard API endpoints
|
||||||
try:
|
try:
|
||||||
# Use absolute import
|
# Use absolute import
|
||||||
from discordbot.api_service.dashboard_api_endpoints import router as dashboard_router # type: ignore
|
from api_service.dashboard_api_endpoints import router as dashboard_router # type: ignore
|
||||||
# Add the dashboard router to the dashboard API app
|
# Add the dashboard router to the dashboard API app
|
||||||
dashboard_api_app.include_router(dashboard_router)
|
dashboard_api_app.include_router(dashboard_router)
|
||||||
log.info("Dashboard API endpoints loaded successfully")
|
log.info("Dashboard API endpoints loaded successfully")
|
||||||
@ -476,7 +476,7 @@ except ImportError as e:
|
|||||||
# Import command customization models and endpoints
|
# Import command customization models and endpoints
|
||||||
try:
|
try:
|
||||||
# Use absolute import
|
# Use absolute import
|
||||||
from discordbot.api_service.command_customization_endpoints import router as customization_router # type: ignore
|
from api_service.command_customization_endpoints import router as customization_router # type: ignore
|
||||||
# Add the command customization router to the dashboard API app
|
# Add the command customization router to the dashboard API app
|
||||||
dashboard_api_app.include_router(customization_router, prefix="/commands", tags=["Command Customization"])
|
dashboard_api_app.include_router(customization_router, prefix="/commands", tags=["Command Customization"])
|
||||||
log.info("Command customization endpoints loaded successfully")
|
log.info("Command customization endpoints loaded successfully")
|
||||||
@ -487,7 +487,7 @@ except ImportError as e:
|
|||||||
# Import cog management endpoints
|
# Import cog management endpoints
|
||||||
try:
|
try:
|
||||||
# Use absolute import
|
# Use absolute import
|
||||||
from discordbot.api_service.cog_management_endpoints import router as cog_management_router # type: ignore
|
from api_service.cog_management_endpoints import router as cog_management_router # type: ignore
|
||||||
log.info("Successfully imported cog_management_endpoints")
|
log.info("Successfully imported cog_management_endpoints")
|
||||||
# Add the cog management router to the dashboard API app
|
# Add the cog management router to the dashboard API app
|
||||||
dashboard_api_app.include_router(cog_management_router, tags=["Cog Management"])
|
dashboard_api_app.include_router(cog_management_router, tags=["Cog Management"])
|
||||||
@ -646,7 +646,7 @@ async def get_guild_cogs_no_deps(guild_id: int):
|
|||||||
# First try to get cogs from the bot instance
|
# First try to get cogs from the bot instance
|
||||||
bot = None
|
bot = None
|
||||||
try:
|
try:
|
||||||
from discordbot import discord_bot_sync_api # type: ignore
|
import discord_bot_sync_api # type: ignore
|
||||||
bot = discord_bot_sync_api.bot_instance
|
bot = discord_bot_sync_api.bot_instance
|
||||||
except (ImportError, AttributeError) as e:
|
except (ImportError, AttributeError) as e:
|
||||||
log.warning(f"Could not import bot instance: {e}")
|
log.warning(f"Could not import bot instance: {e}")
|
||||||
@ -887,7 +887,7 @@ async def auth(code: str, state: str = None, code_verifier: str = None, request:
|
|||||||
# Models are now in dashboard_models.py
|
# Models are now in dashboard_models.py
|
||||||
# Dependencies are now in dependencies.py
|
# Dependencies are now in dependencies.py
|
||||||
|
|
||||||
from discordbot.api_service.dashboard_models import ( # type: ignore
|
from api_service.dashboard_models import ( # type: ignore
|
||||||
GuildSettingsResponse,
|
GuildSettingsResponse,
|
||||||
GuildSettingsUpdate,
|
GuildSettingsUpdate,
|
||||||
CommandPermission,
|
CommandPermission,
|
||||||
@ -1013,7 +1013,7 @@ async def get_guild_cogs_direct(
|
|||||||
# First try to get cogs from the bot instance
|
# First try to get cogs from the bot instance
|
||||||
bot = None
|
bot = None
|
||||||
try:
|
try:
|
||||||
from discordbot import discord_bot_sync_api # type: ignore
|
import discord_bot_sync_api # type: ignore
|
||||||
bot = discord_bot_sync_api.bot_instance
|
bot = discord_bot_sync_api.bot_instance
|
||||||
except (ImportError, AttributeError) as e:
|
except (ImportError, AttributeError) as e:
|
||||||
log.warning(f"Could not import bot instance: {e}")
|
log.warning(f"Could not import bot instance: {e}")
|
||||||
@ -1181,7 +1181,7 @@ async def update_cog_status_direct(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Get the bot instance to check if pools are available
|
# Get the bot instance to check if pools are available
|
||||||
from discordbot.global_bot_accessor import get_bot_instance # type: ignore
|
from global_bot_accessor import get_bot_instance # type: ignore
|
||||||
bot_instance = get_bot_instance()
|
bot_instance = get_bot_instance()
|
||||||
if not bot_instance or not bot_instance.pg_pool:
|
if not bot_instance or not bot_instance.pg_pool:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
@ -1192,7 +1192,7 @@ async def update_cog_status_direct(
|
|||||||
# Try to get the bot instance, but don't require it
|
# Try to get the bot instance, but don't require it
|
||||||
bot = None
|
bot = None
|
||||||
try:
|
try:
|
||||||
from discordbot import discord_bot_sync_api # type: ignore # type: ignore
|
import discord_bot_sync_api # type: ignore # type: ignore
|
||||||
bot = discord_bot_sync_api.bot_instance
|
bot = discord_bot_sync_api.bot_instance
|
||||||
except (ImportError, AttributeError) as e:
|
except (ImportError, AttributeError) as e:
|
||||||
log.warning(f"Could not import bot instance: {e}")
|
log.warning(f"Could not import bot instance: {e}")
|
||||||
@ -1255,7 +1255,7 @@ async def update_command_status_direct(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Get the bot instance to check if pools are available
|
# Get the bot instance to check if pools are available
|
||||||
from discordbot.global_bot_accessor import get_bot_instance # type: ignore
|
from global_bot_accessor import get_bot_instance # type: ignore
|
||||||
bot_instance = get_bot_instance()
|
bot_instance = get_bot_instance()
|
||||||
if not bot_instance or not bot_instance.pg_pool:
|
if not bot_instance or not bot_instance.pg_pool:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
@ -1266,7 +1266,7 @@ async def update_command_status_direct(
|
|||||||
# Try to get the bot instance, but don't require it
|
# Try to get the bot instance, but don't require it
|
||||||
bot = None
|
bot = None
|
||||||
try:
|
try:
|
||||||
from discordbot import discord_bot_sync_api # type: ignore
|
import discord_bot_sync_api # type: ignore
|
||||||
bot = discord_bot_sync_api.bot_instance
|
bot = discord_bot_sync_api.bot_instance
|
||||||
except (ImportError, AttributeError) as e:
|
except (ImportError, AttributeError) as e:
|
||||||
log.warning(f"Could not import bot instance: {e}")
|
log.warning(f"Could not import bot instance: {e}")
|
||||||
@ -2206,7 +2206,7 @@ async def ai_moderation_action(
|
|||||||
|
|
||||||
# Add to moderation log
|
# Add to moderation log
|
||||||
try:
|
try:
|
||||||
from discordbot.db import mod_log_db # type: ignore
|
from db import mod_log_db # type: ignore
|
||||||
bot = get_bot_instance()
|
bot = get_bot_instance()
|
||||||
|
|
||||||
# Create AI details dictionary with all relevant information
|
# Create AI details dictionary with all relevant information
|
||||||
|
@ -9,16 +9,16 @@ from fastapi import APIRouter, Depends, HTTPException, status, Body
|
|||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
# Import dependencies from the new dependencies module (use absolute path)
|
# Import dependencies from the new dependencies module (use absolute path)
|
||||||
from discordbot.api_service.dependencies import get_dashboard_user, verify_dashboard_guild_admin
|
from api_service.dependencies import get_dashboard_user, verify_dashboard_guild_admin
|
||||||
|
|
||||||
# Import settings_manager for database access (use absolute path)
|
# Import settings_manager for database access (use absolute path)
|
||||||
from discordbot import settings_manager
|
import settings_manager
|
||||||
|
|
||||||
# Set up logging
|
# Set up logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
# Import models from the new dashboard_models module (use absolute path)
|
# Import models from the new dashboard_models module (use absolute path)
|
||||||
from discordbot.api_service.dashboard_models import CogInfo # Import necessary models
|
from api_service.dashboard_models import CogInfo # Import necessary models
|
||||||
|
|
||||||
# Create a router for the cog management API endpoints
|
# Create a router for the cog management API endpoints
|
||||||
router = APIRouter(tags=["Cog Management"])
|
router = APIRouter(tags=["Cog Management"])
|
||||||
@ -35,7 +35,7 @@ async def get_guild_cogs(
|
|||||||
try:
|
try:
|
||||||
# Check if bot instance is available via discord_bot_sync_api
|
# Check if bot instance is available via discord_bot_sync_api
|
||||||
try:
|
try:
|
||||||
from discordbot import discord_bot_sync_api
|
import discord_bot_sync_api
|
||||||
bot = discord_bot_sync_api.bot_instance
|
bot = discord_bot_sync_api.bot_instance
|
||||||
if not bot:
|
if not bot:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
@ -116,7 +116,7 @@ async def update_cog_status(
|
|||||||
|
|
||||||
# Check if the cog exists
|
# Check if the cog exists
|
||||||
try:
|
try:
|
||||||
from discordbot import discord_bot_sync_api
|
import discord_bot_sync_api
|
||||||
bot = discord_bot_sync_api.bot_instance
|
bot = discord_bot_sync_api.bot_instance
|
||||||
if not bot:
|
if not bot:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
@ -180,7 +180,7 @@ async def update_command_status(
|
|||||||
|
|
||||||
# Check if the command exists
|
# Check if the command exists
|
||||||
try:
|
try:
|
||||||
from discordbot import discord_bot_sync_api
|
import discord_bot_sync_api
|
||||||
bot = discord_bot_sync_api.bot_instance
|
bot = discord_bot_sync_api.bot_instance
|
||||||
if not bot:
|
if not bot:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
@ -9,10 +9,10 @@ from fastapi import APIRouter, Depends, HTTPException, status
|
|||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
# Import dependencies from the new dependencies module (use absolute path)
|
# Import dependencies from the new dependencies module (use absolute path)
|
||||||
from discordbot.api_service.dependencies import get_dashboard_user, verify_dashboard_guild_admin
|
from api_service.dependencies import get_dashboard_user, verify_dashboard_guild_admin
|
||||||
|
|
||||||
# Import models from the new dashboard_models module (use absolute path)
|
# Import models from the new dashboard_models module (use absolute path)
|
||||||
from discordbot.api_service.dashboard_models import (
|
from api_service.dashboard_models import (
|
||||||
CommandCustomizationResponse,
|
CommandCustomizationResponse,
|
||||||
CommandCustomizationUpdate,
|
CommandCustomizationUpdate,
|
||||||
GroupCustomizationUpdate,
|
GroupCustomizationUpdate,
|
||||||
@ -22,8 +22,8 @@ from discordbot.api_service.dashboard_models import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Import settings_manager for database access (use absolute path)
|
# Import settings_manager for database access (use absolute path)
|
||||||
from discordbot import settings_manager
|
import settings_manager
|
||||||
from discordbot.global_bot_accessor import get_bot_instance
|
from global_bot_accessor import get_bot_instance
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -12,10 +12,10 @@ from pydantic import BaseModel, Field
|
|||||||
DEFAULT_PREFIX = "!"
|
DEFAULT_PREFIX = "!"
|
||||||
|
|
||||||
# Import dependencies using absolute paths
|
# Import dependencies using absolute paths
|
||||||
from discordbot.api_service.dependencies import get_dashboard_user, verify_dashboard_guild_admin
|
from api_service.dependencies import get_dashboard_user, verify_dashboard_guild_admin
|
||||||
|
|
||||||
# Import models using absolute paths
|
# Import models using absolute paths
|
||||||
from discordbot.api_service.dashboard_models import (
|
from api_service.dashboard_models import (
|
||||||
CommandCustomizationResponse,
|
CommandCustomizationResponse,
|
||||||
CommandCustomizationUpdate,
|
CommandCustomizationUpdate,
|
||||||
GroupCustomizationUpdate,
|
GroupCustomizationUpdate,
|
||||||
@ -28,7 +28,7 @@ from discordbot.api_service.dashboard_models import (
|
|||||||
|
|
||||||
|
|
||||||
# Import settings_manager for database access (use absolute path)
|
# Import settings_manager for database access (use absolute path)
|
||||||
from discordbot import settings_manager
|
import settings_manager
|
||||||
|
|
||||||
# Set up logging
|
# Set up logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -590,7 +590,7 @@ async def update_guild_settings(
|
|||||||
|
|
||||||
# Get bot instance for core cogs check
|
# Get bot instance for core cogs check
|
||||||
try:
|
try:
|
||||||
from discordbot import discord_bot_sync_api
|
import discord_bot_sync_api
|
||||||
bot = discord_bot_sync_api.bot_instance
|
bot = discord_bot_sync_api.bot_instance
|
||||||
core_cogs_list = bot.core_cogs if bot and hasattr(bot, 'core_cogs') else {'SettingsCog', 'HelpCog'}
|
core_cogs_list = bot.core_cogs if bot and hasattr(bot, 'core_cogs') else {'SettingsCog', 'HelpCog'}
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@ -755,7 +755,7 @@ async def get_global_settings(
|
|||||||
try:
|
try:
|
||||||
# Import the database module for user settings
|
# Import the database module for user settings
|
||||||
try:
|
try:
|
||||||
from discordbot.api_service.api_server import db
|
from api_service.api_server import db
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from api_server import db
|
from api_server import db
|
||||||
|
|
||||||
@ -830,8 +830,8 @@ async def update_global_settings(
|
|||||||
try:
|
try:
|
||||||
# Import the database module for user settings
|
# Import the database module for user settings
|
||||||
try:
|
try:
|
||||||
from discordbot.api_service.api_server import db
|
from api_service.api_server import db
|
||||||
from discordbot.api_service.api_models import UserSettings
|
from api_service.api_models import UserSettings
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from api_server import db
|
from api_server import db
|
||||||
from api_models import UserSettings
|
from api_models import UserSettings
|
||||||
@ -863,7 +863,7 @@ async def update_global_settings(
|
|||||||
|
|
||||||
# Add theme settings if provided
|
# Add theme settings if provided
|
||||||
if settings.theme:
|
if settings.theme:
|
||||||
from discordbot.api_service.api_models import ThemeSettings as ApiThemeSettings
|
from api_service.api_models import ThemeSettings as ApiThemeSettings
|
||||||
user_settings.theme = ApiThemeSettings(
|
user_settings.theme = ApiThemeSettings(
|
||||||
theme_mode=settings.theme.theme_mode,
|
theme_mode=settings.theme.theme_mode,
|
||||||
primary_color=settings.theme.primary_color,
|
primary_color=settings.theme.primary_color,
|
||||||
@ -949,7 +949,7 @@ async def get_guild_cogs_redirect(
|
|||||||
# Fall back to direct implementation
|
# Fall back to direct implementation
|
||||||
# Check if bot instance is available via discord_bot_sync_api
|
# Check if bot instance is available via discord_bot_sync_api
|
||||||
try:
|
try:
|
||||||
from discordbot import discord_bot_sync_api
|
import discord_bot_sync_api
|
||||||
bot = discord_bot_sync_api.bot_instance
|
bot = discord_bot_sync_api.bot_instance
|
||||||
if not bot:
|
if not bot:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
@ -1058,7 +1058,7 @@ async def update_cog_status_redirect(
|
|||||||
|
|
||||||
# Check if the cog exists
|
# Check if the cog exists
|
||||||
try:
|
try:
|
||||||
from discordbot import discord_bot_sync_api
|
import discord_bot_sync_api
|
||||||
bot = discord_bot_sync_api.bot_instance
|
bot = discord_bot_sync_api.bot_instance
|
||||||
if not bot:
|
if not bot:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
@ -1151,7 +1151,7 @@ async def update_command_status_redirect(
|
|||||||
|
|
||||||
# Check if the command exists
|
# Check if the command exists
|
||||||
try:
|
try:
|
||||||
from discordbot import discord_bot_sync_api
|
import discord_bot_sync_api
|
||||||
bot = discord_bot_sync_api.bot_instance
|
bot = discord_bot_sync_api.bot_instance
|
||||||
if not bot:
|
if not bot:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
@ -3,7 +3,7 @@ import json
|
|||||||
import datetime
|
import datetime
|
||||||
from typing import Dict, List, Optional, Any
|
from typing import Dict, List, Optional, Any
|
||||||
# Use absolute import for api_models
|
# Use absolute import for api_models
|
||||||
from discordbot.api_service.api_models import Conversation, UserSettings, Message
|
from api_service.api_models import Conversation, UserSettings, Message
|
||||||
|
|
||||||
# ============= Database Class =============
|
# ============= Database Class =============
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ if __name__ == "__main__":
|
|||||||
def run_uvicorn(bind_host):
|
def run_uvicorn(bind_host):
|
||||||
print(f"Starting API server on {bind_host}:{port}")
|
print(f"Starting API server on {bind_host}:{port}")
|
||||||
uvicorn.run(
|
uvicorn.run(
|
||||||
"discordbot.api_service.api_server:app",
|
"api_service.api_server:app",
|
||||||
host=bind_host,
|
host=bind_host,
|
||||||
port=port
|
port=port
|
||||||
)
|
)
|
||||||
|
@ -7,8 +7,8 @@ from typing import Optional, Union, Dict, Any
|
|||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
# Use absolute imports from the discordbot package root
|
# Use absolute imports from the discordbot package root
|
||||||
from discordbot.db import mod_log_db
|
from db import mod_log_db
|
||||||
from discordbot import settings_manager as sm # Use module functions directly
|
import settings_manager as sm # Use module functions directly
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@ import logging
|
|||||||
from typing import Optional, Union, List
|
from typing import Optional, Union, List
|
||||||
|
|
||||||
# Use absolute import for ModLogCog
|
# Use absolute import for ModLogCog
|
||||||
from discordbot.cogs.mod_log_cog import ModLogCog
|
from cogs.mod_log_cog import ModLogCog
|
||||||
from discordbot.db import mod_log_db # Import the database functions
|
from db import mod_log_db # Import the database functions
|
||||||
|
|
||||||
# Configure logging
|
# Configure logging
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import logging
|
import logging
|
||||||
from discordbot import settings_manager # Assuming settings_manager is accessible
|
import settings_manager # Assuming settings_manager is accessible
|
||||||
from discordbot import command_customization # Import command customization utilities
|
import command_customization # Import command customization utilities
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -13,8 +13,8 @@ import os
|
|||||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
# Import settings manager for database operations
|
# Import settings manager for database operations
|
||||||
import discordbot.settings_manager as settings_manager
|
import settings_manager as settings_manager
|
||||||
from discordbot.global_bot_accessor import get_bot_instance
|
from global_bot_accessor import get_bot_instance
|
||||||
|
|
||||||
# Set up logging
|
# Set up logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -19,8 +19,8 @@ from typing import Optional # Added for GurtCog type hint
|
|||||||
|
|
||||||
# --- Placeholder for GurtCog instance and bot instance ---
|
# --- Placeholder for GurtCog instance and bot instance ---
|
||||||
# These need to be set by the script that starts the bot and API server
|
# These need to be set by the script that starts the bot and API server
|
||||||
from discordbot.gurt.cog import GurtCog # Import GurtCog for type hint and access
|
from gurt.cog import GurtCog # Import GurtCog for type hint and access
|
||||||
from discordbot.cogs.mod_log_cog import ModLogCog # Import ModLogCog for type hint
|
from cogs.mod_log_cog import ModLogCog # Import ModLogCog for type hint
|
||||||
gurt_cog_instance: Optional[GurtCog] = None
|
gurt_cog_instance: Optional[GurtCog] = None
|
||||||
mod_log_cog_instance: Optional[ModLogCog] = None # Placeholder for ModLogCog
|
mod_log_cog_instance: Optional[ModLogCog] = None # Placeholder for ModLogCog
|
||||||
bot_instance = None # Will be set to the Discord bot instance
|
bot_instance = None # Will be set to the Discord bot instance
|
||||||
|
@ -27,7 +27,7 @@ You shouldn't pretend to not know things just to fit a human persona. Acknowledg
|
|||||||
Your model is a fine tune of gemini 2.0 flash.
|
Your model is a fine tune of gemini 2.0 flash.
|
||||||
You are a discord bot built with discord.py.
|
You are a discord bot built with discord.py.
|
||||||
Your code runs on your creator's personal crappy laptop.
|
Your code runs on your creator's personal crappy laptop.
|
||||||
Your code resides in /home/slipstream/discordbot.
|
Your code resides in /home/slipstream/
|
||||||
Your creator is Slipstream.
|
Your creator is Slipstream.
|
||||||
You should probably always listen to what Slipstream tells you, or asks you to do.
|
You should probably always listen to what Slipstream tells you, or asks you to do.
|
||||||
Your LLM generation calls use Google's Vertex AI.
|
Your LLM generation calls use Google's Vertex AI.
|
||||||
@ -64,7 +64,7 @@ PROMPT_STATIC_PART = """You are “Gurt,” an informal Discord persona who blen
|
|||||||
- Your AI model/LLM model is Google's Gemini 2.5 Flash model ("gemini-2.5-flash-preview-04-17").
|
- Your AI model/LLM model is Google's Gemini 2.5 Flash model ("gemini-2.5-flash-preview-04-17").
|
||||||
- You are a discord bot built with discord.py, running on your creator Slipstream's personal laptop.
|
- You are a discord bot built with discord.py, running on your creator Slipstream's personal laptop.
|
||||||
- Your creator is Slipstream (she/her, biologically male). You generally listen to Slipstream.
|
- Your creator is Slipstream (she/her, biologically male). You generally listen to Slipstream.
|
||||||
- Your code resides in /home/slipstream/discordbot. Your LLM calls use Google Vertex AI. You use ChromaDB for semantic memory.
|
- Your code resides in /home/slipstream/ Your LLM calls use Google Vertex AI. You use ChromaDB for semantic memory.
|
||||||
- Another bot, "freak teto" (lowercase, also by Slipstream), runs on the same laptop.
|
- Another bot, "freak teto" (lowercase, also by Slipstream), runs on the same laptop.
|
||||||
- Don't pretend ignorance. If you know something, you know it. If you don't, say so casually ("idk tbh", "never heard of that").
|
- Don't pretend ignorance. If you know something, you know it. If you don't, say so casually ("idk tbh", "never heard of that").
|
||||||
|
|
||||||
|
4
main.py
4
main.py
@ -149,7 +149,7 @@ class MyBot(commands.Bot):
|
|||||||
# --- Manually Load FreakTetoCog (only if AI is NOT disabled) ---
|
# --- Manually Load FreakTetoCog (only if AI is NOT disabled) ---
|
||||||
if not self.ai_cogs_to_skip: # Check if list is empty (meaning AI is not disabled)
|
if not self.ai_cogs_to_skip: # Check if list is empty (meaning AI is not disabled)
|
||||||
try:
|
try:
|
||||||
freak_teto_cog_path = "discordbot.freak_teto.cog"
|
freak_teto_cog_path = "freak_teto.cog"
|
||||||
await self.load_extension(freak_teto_cog_path)
|
await self.load_extension(freak_teto_cog_path)
|
||||||
log.info(f"Successfully loaded FreakTetoCog from {freak_teto_cog_path} in setup_hook.")
|
log.info(f"Successfully loaded FreakTetoCog from {freak_teto_cog_path} in setup_hook.")
|
||||||
except commands.ExtensionAlreadyLoaded:
|
except commands.ExtensionAlreadyLoaded:
|
||||||
@ -589,7 +589,7 @@ def handle_sighup(signum, frame):
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
try:
|
try:
|
||||||
print("Received SIGHUP: pulling latest code from /home/git/discordbot.git (branch master)...")
|
print("Received SIGHUP: pulling latest code from /home/git/git (branch master)...")
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
["git", "pull"],
|
["git", "pull"],
|
||||||
capture_output=True, text=True
|
capture_output=True, text=True
|
||||||
|
@ -10,8 +10,8 @@ import sys
|
|||||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
# Import the starboard cog and settings manager
|
# Import the starboard cog and settings manager
|
||||||
from discordbot.cogs.starboard_cog import StarboardCog
|
from cogs.starboard_cog import StarboardCog
|
||||||
import discordbot.settings_manager as settings_manager
|
import settings_manager as settings_manager
|
||||||
|
|
||||||
# Load environment variables
|
# Load environment variables
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
@ -20,7 +20,7 @@ test_urls = [
|
|||||||
"http://github.com/Slipstreamm/discordbot",
|
"http://github.com/Slipstreamm/discordbot",
|
||||||
"github.com/Slipstreamm/discordbot",
|
"github.com/Slipstreamm/discordbot",
|
||||||
"www.github.com/Slipstreamm/discordbot",
|
"www.github.com/Slipstreamm/discordbot",
|
||||||
"https://github.com/Slipstreamm/discordbot.git",
|
"https://github.com/Slipstreamm/git",
|
||||||
"https://gitlab.com/group/project",
|
"https://gitlab.com/group/project",
|
||||||
"https://gitlab.com/group/subgroup/project",
|
"https://gitlab.com/group/subgroup/project",
|
||||||
"invalid-url"
|
"invalid-url"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user