Initial commit: Discord automation tools

This commit is contained in:
2026-01-27 10:13:41 +01:00
commit 7f5d3c2ca7
41 changed files with 983407 additions and 0 deletions

0
config/__init__.py Executable file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

44
config/settings.py Executable file
View File

@@ -0,0 +1,44 @@
# discord_tools/config/settings.py
import os
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
# Discord API settings
DISCORD_API_BASE_URL = "https://discord.com/api/v9"
DISCORD_TOKEN = os.getenv('DISCORD_TOKEN')
# Rate limiting settings
RATE_LIMIT_ATTEMPTS = 5
RATE_LIMIT_DELAY = 5 # seconds
# Logging settings
LOG_LEVEL = "INFO"
LOG_FILE = "discord_tools.log"
# File paths
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DATA_DIR = os.path.join(BASE_DIR, "data")
# Ensure data directory exists
os.makedirs(DATA_DIR, exist_ok=True)
# Default values for various tools
DEFAULT_STATUS_UPDATE_INTERVAL = 60 # seconds
MAX_MESSAGES_PER_REQUEST = 100
DEFAULT_AVATAR_SIZE = 128 # pixels
# Error messages
ERROR_MESSAGES = {
"token_not_found": "Discord token not found. Please set the DISCORD_TOKEN environment variable.",
"rate_limit_exceeded": "Rate limit exceeded. Please try again later.",
"api_error": "An error occurred while communicating with the Discord API.",
"file_not_found": "The specified file was not found.",
"invalid_input": "Invalid input provided. Please check your input and try again.",
}
# Validate required settings
if not DISCORD_TOKEN:
raise ValueError(ERROR_MESSAGES["token_not_found"])