From 75aa141e074a2b7aba82ce8fd17ec40ced7a560d Mon Sep 17 00:00:00 2001 From: bereck-work Date: Wed, 17 Dec 2025 14:45:57 +0000 Subject: [PATCH] (Feat): New Features --- .dockerignore | 24 ++++++++ .gitignore | 4 +- Dockerfile | 29 ++++++++++ config.example.toml | 89 +++++++++++++++++++++++++++++ docker-compose.yml | 21 +++++++ src/commands/developer/blacklist.ts | 2 +- src/events/ready.ts | 2 +- src/index.ts | 4 +- 8 files changed, 169 insertions(+), 6 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..613d6ff --- /dev/null +++ b/.dockerignore @@ -0,0 +1,24 @@ +# Git +.git +.gitignore + +# IDE +.vscode +.idea +.qodo + +# Documentation +*.md +!README.md + +# Local data (will be mounted as volumes) +data/ +logs/ + +# Environment files (will be passed via docker-compose) +.env +.env.* +!.env.example + +# Misc +GEM/ diff --git a/.gitignore b/.gitignore index 86a4077..cca9087 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,6 @@ build/ config.toml PORTING_DOCUMENTATION.md -pikanetwork.js -GEM +pikanetwork.js/ +GEM/ .qodo \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..531dbaa --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +# Elly Discord Bot Dockerfile +# ============================ + +FROM denoland/deno:2.1.4 + +# Set working directory +WORKDIR /app + +# Copy dependency files first for better caching +COPY deno.json deno.lock ./ + +# Cache dependencies +RUN deno cache --reload npm:discord.js@^14.14.1 npm:@discordjs/rest@^2.2.0 npm:@toml-tools/parser@^1.0.0 + +# Copy source code +COPY src/ ./src/ +COPY pikanetwork.js/ ./pikanetwork.js/ + +# Copy config (will be overridden by volume mount in production) +COPY config.example.toml ./config.example.toml + +# Create data and logs directories +RUN mkdir -p /app/data /app/logs + +# Cache the main application +RUN deno cache --unstable-ffi src/index.ts + +# Run the bot +CMD ["deno", "run", "--allow-net", "--allow-read", "--allow-write", "--allow-env", "--allow-ffi", "--unstable-ffi", "src/index.ts"] diff --git a/config.example.toml b/config.example.toml index e69de29..9ec724b 100644 --- a/config.example.toml +++ b/config.example.toml @@ -0,0 +1,89 @@ +# Elly Discord Bot Configuration +# ================================ + +[bot] +name = "" +prefix = "" +status = "" +activity_type = "watching" # playing, streaming, listening, watching, competing + +[bot.owners] +ids = [ + "", + "", + "", + "" +] + +[database] +path = "./data/elly.db" + +[api] +pika_cache_ttl = 3600000 # 1 hour in ms +pika_request_timeout = 10000 # 10 seconds + +[guild] +id = "" +name = "" + +[channels] +applications = "applications" +application_logs = "reviewed-applications" +suggestions = "suggestions" +suggestion_logs = "reviewed-suggestions" +guild_updates = "guild-updates" +discord_changelog = "discord-changelog" +inactivity = "inactivity-notices" +development_logs = "development-logs" +donations = "donations" +reminders = "reminders" + +[roles] +admin = "Admin" +leader = "Leader" +officer = "Officer" +developer = "Developer" +guild_member = "Guild Member" +champion = "Champion" +away = "Away" +applications_blacklisted = "Applications blacklisted" +suggestions_blacklisted = "Suggestions Blacklisted" + +[roles.manageable] +ids = [ + "", + "", + "", + "", + "" +] + +[features] +applications = true +suggestions = true +statistics = true +family = true +qotd = true +reminders = true +staff_simulator = true +channel_filtering = true +auto_moderation = false +welcome_system = false +level_system = false + +[limits] +champion_max_days = 366 +away_max_days = 355 +purge_max_messages = 100 +reminder_max_duration_days = 365 + +[colors] +primary = 0x5865F2 +success = 0x57F287 +warning = 0xFEE75C +error = 0xED4245 +info = 0x5865F2 + +[logging] +level = "info" # debug, info, warn, error +file = "./logs/elly.log" diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a54f729 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +# Elly Discord Bot - Docker Compose +# =================================== + +services: + elly-bot: + build: + context: . + dockerfile: Dockerfile + container_name: elly-discord-bot + restart: unless-stopped + env_file: + - .env + volumes: + # Persist database and logs + - ./data:/app/data + - ./logs:/app/logs + # Mount config file (create config.toml from config.example.toml) + - ./config.toml:/app/config.toml:ro + # Optional: Set timezone + environment: + - TZ=UTC diff --git a/src/commands/developer/blacklist.ts b/src/commands/developer/blacklist.ts index 6a76daa..491c3b4 100644 --- a/src/commands/developer/blacklist.ts +++ b/src/commands/developer/blacklist.ts @@ -103,7 +103,7 @@ export const blacklistCommand: Command = { switch (subcommand) { case 'add': await handleAdd(interaction, client); - break; + break;https://www.ccavenue.com/https://www.ccavenue.com/ case 'remove': await handleRemove(interaction, client); break; diff --git a/src/events/ready.ts b/src/events/ready.ts index f69554b..46e98c5 100644 --- a/src/events/ready.ts +++ b/src/events/ready.ts @@ -14,7 +14,7 @@ export const readyEvent: BotEvent = { async execute(client: EllyClient): Promise { console.log(''); client.logger.info('═══════════════════════════════════════════════════════'); - client.logger.info(' BOT CONNECTED '); + client.logger.info(' BOT CONNECTED '); client.logger.info('═══════════════════════════════════════════════════════'); client.logger.info(`✓ Logged in as: ${client.user?.tag}`); client.logger.info(` ├─ User ID: ${client.user?.id}`); diff --git a/src/index.ts b/src/index.ts index 2a128fd..e4ef843 100644 --- a/src/index.ts +++ b/src/index.ts @@ -52,8 +52,8 @@ const logger = createLogger('Main'); async function main(): Promise { console.log(''); console.log('╔═══════════════════════════════════════════════════════════╗'); - console.log('║ 🌸 ELLY DISCORD BOT 🌸 ║'); - console.log('║ v1.0.0 - TypeScript ║'); + console.log('║ 🌸 ELLY DISCORD BOT 🌸 ║'); + console.log('║ v1.0.0 - TypeScript ║'); console.log('╚═══════════════════════════════════════════════════════════╝'); console.log('');