Add NPC interaction system with memory and quest generation

- Introduced a new NPC system with dynamic NPCs and conversation handling.
- Implemented NPC memory using SQLite to log conversations and manage relationships.
- Added commands for talking to NPCs, listing available NPCs, and generating quests.
- Updated database schema to support NPC conversations and relationships.
- Refactored code structure to separate concerns into cogs and handlers.
This commit is contained in:
2025-09-30 14:12:22 +02:00
parent c8980f785f
commit 7e76353c6a
24 changed files with 7468 additions and 14 deletions
+9 -2
View File
@@ -5,10 +5,12 @@ import os
from dotenv import load_dotenv
from web.app import app
import threading
import itertools
def run_web():
app.run(debug=False, host="0.0.0.0", port=5000)
app.run(debug=False, host="0.0.0.0", port=8080)
return
class MyNewHelp(commands.MinimalHelpCommand):
@@ -22,12 +24,17 @@ class MyNewHelp(commands.MinimalHelpCommand):
class Client(commands.Bot):
def __init__(self):
super().__init__(
command_prefix=["pY ", "PY ", "Py ", "py "],
command_prefix=self.iterate_prefix("py"),
strip_after_prefix=True,
case_insensitive=True,
intents=discord.Intents.all(),
help_command=MyNewHelp(),
)
def iterate_prefix(self, prefix):
prefixes = list(map(''.join, itertools.product(*zip(prefix.upper(), prefix.lower()))))
print(prefixes)
return prefixes
async def setup_hook(self): # overwriting a handler
cogs_folder = f"{os.path.abspath(os.path.dirname(__file__))}/cogs"