mirror of
https://github.com/alterware/aw-bot.git
synced 2025-10-26 14:15:54 +00:00
16 lines
381 B
Python
16 lines
381 B
Python
import json
|
|
import os
|
|
from database import get_patterns
|
|
|
|
PATTERNS_FILE = "patterns.json"
|
|
|
|
BOT_DATA_DIR = os.getenv("BOT_DATA_DIR", "/bot-data")
|
|
|
|
message_patterns = get_patterns()
|
|
|
|
|
|
def update_patterns(regex: str, response: str):
|
|
"""update patterns in memory."""
|
|
message_patterns.append({"regex": regex, "response": response})
|
|
print(f"Pattern added in memory: {regex}")
|